1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-25 16:02:33 +01:00

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
2015-04-25 12:46:45 +02:00
committed by Carlos R. Mafra
parent bc4f3352b6
commit e03088ebe2
2 changed files with 4 additions and 4 deletions

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;
}