From ad852a184d1b099fd509bb818c75d484f76dca7d Mon Sep 17 00:00:00 2001 From: Xin LI Date: Tue, 23 Jun 2009 23:37:25 +0000 Subject: [PATCH] %.s expects an int as the length specifier, so cast properly. --- usr.bin/makewhatis/makewhatis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/makewhatis/makewhatis.c b/usr.bin/makewhatis/makewhatis.c index c9404f6bae21..6b2dce4e5950 100644 --- a/usr.bin/makewhatis/makewhatis.c +++ b/usr.bin/makewhatis/makewhatis.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -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;