]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/vsscanf.c.patch
Libc-763.12.tar.gz
[apple/libc.git] / stdio / FreeBSD / vsscanf.c.patch
1 --- vsscanf.c.orig 2011-03-01 17:54:44.000000000 -0800
2 +++ vsscanf.c 2011-03-01 18:03:46.000000000 -0800
3 @@ -36,6 +36,8 @@ static char sccsid[] = "@(#)vsscanf.c 8.
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/vsscanf.c,v 1.14 2008/04/17 22:17:54 jhb Exp $");
6
7 +#include "xlocale_private.h"
8 +
9 #include <stdio.h>
10 #include <string.h>
11 #include "local.h"
12 @@ -55,12 +57,16 @@ eofread(cookie, buf, len)
13 }
14
15 int
16 -vsscanf(str, fmt, ap)
17 +vsscanf_l(str, loc, fmt, ap)
18 const char * __restrict str;
19 + locale_t loc;
20 const char * __restrict fmt;
21 __va_list ap;
22 {
23 FILE f;
24 + struct __sFILEX ext;
25 + f._extra = &ext;
26 + INITEXTRA(&f);
27
28 f._file = -1;
29 f._flags = __SRD;
30 @@ -71,5 +77,15 @@ vsscanf(str, fmt, ap)
31 f._lb._base = NULL;
32 f._orientation = 0;
33 memset(&f._mbstate, 0, sizeof(mbstate_t));
34 - return (__svfscanf(&f, fmt, ap));
35 + return (__svfscanf_l(&f, loc, fmt, ap));
36 }
37 +
38 +int
39 +vsscanf(str, fmt, ap)
40 + const char * __restrict str;
41 + const char * __restrict fmt;
42 + __va_list ap;
43 +{
44 + return vsscanf_l(str, __current_locale(), fmt, ap);
45 +}
46 +