1 --- sprintf.c.orig 2009-11-30 16:15:30.000000000 -0800
2 +++ sprintf.c 2009-12-02 16:49:29.000000000 -0800
3 @@ -36,6 +36,8 @@ static char sccsid[] = "@(#)sprintf.c 8.
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/sprintf.c,v 1.16 2008/04/17 22:17:54 jhb Exp $");
7 +#include "xlocale_private.h"
12 @@ -46,17 +48,21 @@ sprintf(char * __restrict str, char cons
19 - f._flags = __SWR | __SSTR;
20 - f._bf._base = f._p = (unsigned char *)str;
21 - f._bf._size = f._w = INT_MAX;
23 - memset(&f._mbstate, 0, sizeof(mbstate_t));
25 - ret = __vfprintf(&f, fmt, ap);
26 + ret = vsprintf_l(str, __current_locale(), fmt, ap);
32 +sprintf_l(char * __restrict str, locale_t loc, char const * __restrict fmt, ...)
38 + ret = vsprintf_l(str, loc, fmt, ap);