wmaker: fix non-portable int argument for printf in error message

The original code assumed that the sizeof returns a long int type, which is
true on 64 bits platform but not on 32 bits platforms, as pointed by gcc.

The new code does an explicit conversions to 'int' (which should be enough
for that case) so the format specifier in printf will always be ok,
whatever platform Window Maker is compiled for.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS authored and Carlos R. Mafra committed 2015-04-25 07:53:07 -04:00
1 parent bc4f3352b6
commit e03088ebe2
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -346,9 +346,9 @@ msgstr ""
#: ../src/dialog.c:594
#, c-format
msgid "full path for file \"%s\" in \"%s\" is longer than %ld bytes, skipped"
msgid "full path for file \"%s\" in \"%s\" is longer than %d bytes, skipped"
msgstr ""
"volledig pad voor bestand \"%s\" in \"%s\" is langer dan %ld byte, "
"volledig pad voor bestand \"%s\" in \"%s\" is langer dan %d byte, "
"overgeslagen"
#: ../src/dialog.c:628
+2 -2
View File
@@ -591,8 +591,8 @@ static void listPixmaps(WScreen *scr, WMList *lPtr, const char *path)
if (wstrlcpy(pbuf, apath, sizeof(pbuf)) >= sizeof(pbuf) ||
wstrlcat(pbuf, "/", sizeof(pbuf)) >= sizeof(pbuf) ||
wstrlcat(pbuf, dentry->d_name, sizeof(pbuf)) >= sizeof(pbuf)) {
wwarning(_("full path for file \"%s\" in \"%s\" is longer than %ld bytes, skipped"),
dentry->d_name, path, sizeof(pbuf) - 1);
wwarning(_("full path for file \"%s\" in \"%s\" is longer than %d bytes, skipped"),
dentry->d_name, path, (int) (sizeof(pbuf) - 1) );
continue;
}