svn commit: r202649 - head/usr.bin/unifdef

Tony Finch fanf at FreeBSD.org
Tue Jan 19 20:35:44 UTC 2010


Author: fanf
Date: Tue Jan 19 20:35:44 2010
New Revision: 202649
URL: http://svn.freebsd.org/changeset/base/202649

Log:
  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.

Modified:
  head/usr.bin/unifdef/unifdef.c

Modified: head/usr.bin/unifdef/unifdef.c
==============================================================================
--- head/usr.bin/unifdef/unifdef.c	Tue Jan 19 20:19:52 2010	(r202648)
+++ head/usr.bin/unifdef/unifdef.c	Tue Jan 19 20:35:44 2010	(r202649)
@@ -334,7 +334,7 @@ main(int argc, char *argv[])
 			if (dirsep != NULL)
 				snprintf(tempname, sizeof(tempname),
 				    "%.*s/" TEMPLATE,
-				    dirsep - ofilename, ofilename);
+				    (int)(dirsep - ofilename), ofilename);
 			else
 				strlcpy(tempname, TEMPLATE, sizeof(tempname));
 			ofd = mkstemp(tempname);


More information about the svn-src-head mailing list