Fix portability to 64 bit platforms.

printf("%.*s",i,s) expects an int not a ptrdiff_t

Thanks to bf1783 (at) googlemail.com for the bug report.
This commit is contained in:
Tony Finch 2010-01-19 20:35:44 +00:00
parent 6628ca0a98
commit 8e23f2a641

View File

@ -334,7 +334,7 @@ main(int argc, char *argv[])
if (dirsep != NULL) if (dirsep != NULL)
snprintf(tempname, sizeof(tempname), snprintf(tempname, sizeof(tempname),
"%.*s/" TEMPLATE, "%.*s/" TEMPLATE,
dirsep - ofilename, ofilename); (int)(dirsep - ofilename), ofilename);
else else
strlcpy(tempname, TEMPLATE, sizeof(tempname)); strlcpy(tempname, TEMPLATE, sizeof(tempname));
ofd = mkstemp(tempname); ofd = mkstemp(tempname);