1 --- snprintf.c.orig 2009-11-30 16:15:30.000000000 -0800
2 +++ snprintf.c 2009-12-02 16:48:44.000000000 -0800
3 @@ -36,6 +36,8 @@ static char sccsid[] = "@(#)snprintf.c 8
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/snprintf.c,v 1.22 2008/04/17 22:17:54 jhb Exp $");
7 +#include "xlocale_private.h"
12 @@ -45,26 +47,24 @@ __FBSDID("$FreeBSD: src/lib/libc/stdio/s
14 snprintf(char * __restrict str, size_t n, char const * __restrict fmt, ...)
28 - f._flags = __SWR | __SSTR;
29 - f._bf._base = f._p = (unsigned char *)str;
30 - f._bf._size = f._w = n;
32 - memset(&f._mbstate, 0, sizeof(mbstate_t));
33 - ret = __vfprintf(&f, fmt, ap);
36 + ret = vsnprintf_l(str, n, __current_locale(), fmt, ap);
42 +snprintf_l(char * __restrict str, size_t n, locale_t loc,
43 + char const * __restrict fmt, ...)
49 + ret = vsnprintf_l(str, n, loc, fmt, ap);