Loading...
--- Libc/Libc-498/stdio/FreeBSD/sprintf.c.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- sprintf.c.orig 2003-05-20 15:22:43.000000000 -0700
-+++ sprintf.c 2005-02-23 16:40:52.000000000 -0800
-@@ -40,6 +40,8 @@
- #include <sys/cdefs.h>
- __FBSDID("$FreeBSD: src/lib/libc/stdio/sprintf.c,v 1.14 2002/09/06 11:23:55 tjr Exp $");
-
-+#include "xlocale_private.h"
-+
- #include <stdio.h>
- #include <stdarg.h>
- #include <limits.h>
-@@ -60,7 +62,29 @@
- f._extra = &ext;
- INITEXTRA(&f);
- va_start(ap, fmt);
-- ret = __vfprintf(&f, fmt, ap);
-+ ret = __vfprintf(&f, __current_locale(), fmt, ap);
-+ va_end(ap);
-+ *f._p = 0;
-+ return (ret);
-+}
-+
-+int
-+sprintf_l(char * __restrict str, locale_t loc, char const * __restrict fmt, ...)
-+{
-+ int ret;
-+ va_list ap;
-+ FILE f;
-+ struct __sFILEX ext;
-+
-+ NORMALIZE_LOCALE(loc);
-+ f._file = -1;
-+ f._flags = __SWR | __SSTR;
-+ f._bf._base = f._p = (unsigned char *)str;
-+ f._bf._size = f._w = INT_MAX;
-+ f._extra = &ext;
-+ INITEXTRA(&f);
-+ va_start(ap, fmt);
-+ ret = __vfprintf(&f, loc, fmt, ap);
- va_end(ap);
- *f._p = 0;
- return (ret);