svn commit: r194798 - head/usr.bin/makewhatis

Xin LI delphij at FreeBSD.org
Tue Jun 23 23:37:26 UTC 2009


Author: delphij
Date: Tue Jun 23 23:37:25 2009
New Revision: 194798
URL: http://svn.freebsd.org/changeset/base/194798

Log:
  %.s expects an int as the length specifier, so cast properly.

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

Modified: head/usr.bin/makewhatis/makewhatis.c
==============================================================================
--- head/usr.bin/makewhatis/makewhatis.c	Tue Jun 23 23:34:46 2009	(r194797)
+++ head/usr.bin/makewhatis/makewhatis.c	Tue Jun 23 23:37:25 2009	(r194798)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <ctype.h>
 #include <dirent.h>
 #include <err.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -1002,7 +1003,7 @@ main(int argc, char **argv)
 				char *sep = strchr(locale, '_');
 				if (sep != NULL && isupper(sep[1]) &&
 				    isupper(sep[2])) {
-					asprintf(&lang_locale, "%.*s%s", sep - locale, locale, &sep[3]);
+					asprintf(&lang_locale, "%.*s%s", (int)(ptrdiff_t)(sep - locale), locale, &sep[3]);
 				}
 			}
 			break;


More information about the svn-src-head mailing list