]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/asprintf.c.patch
bc4158852e74290a0919f30f41f2bf83c62fd2ea
[apple/libc.git] / stdio / FreeBSD / asprintf.c.patch
1 --- asprintf.c.bsdnew 2009-11-11 19:15:16.000000000 -0800
2 +++ asprintf.c 2009-11-11 19:15:42.000000000 -0800
3 @@ -33,6 +33,8 @@
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/asprintf.c,v 1.15 2009/03/02 04:11:42 das Exp $");
6
7 +#include "xlocale_private.h"
8 +
9 #include <stdio.h>
10 #include <stdarg.h>
11
12 @@ -43,7 +45,19 @@ asprintf(char ** __restrict s, char cons
13 va_list ap;
14
15 va_start(ap, fmt);
16 - ret = vasprintf(s, fmt, ap);
17 + ret = vasprintf_l(s, __current_locale(), fmt, ap);
18 + va_end(ap);
19 + return (ret);
20 +}
21 +
22 +int
23 +asprintf_l(char ** __restrict s, locale_t loc, char const * __restrict fmt, ...)
24 +{
25 + int ret;
26 + va_list ap;
27 +
28 + va_start(ap, fmt);
29 + ret = vasprintf_l(s, loc, fmt, ap);
30 va_end(ap);
31 return (ret);
32 }