From e03088ebe24cd8c12d4389687318c954953291a7 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sat, 25 Apr 2015 12:46:45 +0200 Subject: [PATCH] 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 --- po/nl.po | 4 ++-- src/dialog.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/po/nl.po b/po/nl.po index 35cb850d..674c6423 100644 --- a/po/nl.po +++ b/po/nl.po @@ -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 diff --git a/src/dialog.c b/src/dialog.c index b7b8f530..56cd3dba 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -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; }