aports/testing/apt-dater/gcc14.patch

37 lines
1.8 KiB
Diff

Fix -Wint-conversion error with gcc 14.
```
screen.c: In function 'screen_get_sdir':
screen.c:49:21: error: passing argument 2 of 'g_strlcpy' makes pointer from integer without a cast [-Wint-conversion]
49 | g_strlcpy(sdir, sizeof(sdir), getenv("SCREENDIR"));
| ^~~~~~~~~~~~
| |
| long unsigned int
In file included from /usr/include/glib-2.0/glib/gstring.h:37,
from /usr/include/glib-2.0/glib/giochannel.h:36,
from /usr/include/glib-2.0/glib.h:56,
from screen.c:29:
/usr/include/glib-2.0/glib/gstrfuncs.h:124:55: note: expected 'const gchar *' {aka 'const char *'} but argument is of type 'long unsigned int'
124 | const gchar *src,
| ~~~~~~~~~~~~~~^~~
screen.c:49:35: error: passing argument 3 of 'g_strlcpy' makes integer from pointer without a cast [-Wint-conversion]
49 | g_strlcpy(sdir, sizeof(sdir), getenv("SCREENDIR"));
| ^~~~~~~~~~~~~~~~~~~
| |
| char *
/usr/include/glib-2.0/glib/gstrfuncs.h:125:55: note: expected 'gsize' {aka 'long unsigned int'} but argument is of type 'char *'
125 | gsize dest_size);
| ~~~~~~~~~~~~~~^~~~~~~~~
```
--- apt-dater-1.0.4-origin/src/screen.c
+++ apt-dater-1.0.4/src/screen.c
@@ -46,7 +46,7 @@
static gchar sdir[PATH_MAX];
if (g_strcmp0(getenv("SCREENDIR"), NULL) != 0) {
- g_strlcpy(sdir, sizeof(sdir), getenv("SCREENDIR"));
+ g_strlcpy(sdir, getenv("SCREENDIR"), sizeof(sdir));
return sdir;
}