]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/vsscanf.c.patch
Libc-583.tar.gz
[apple/libc.git] / stdio / FreeBSD / vsscanf.c.patch
1 --- vsscanf.c.orig 2003-05-20 15:22:44.000000000 -0700
2 +++ vsscanf.c 2005-02-23 16:57:18.000000000 -0800
3 @@ -40,6 +40,8 @@
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/vsscanf.c,v 1.12 2002/10/12 16:13:41 mike Exp $");
6
7 +#include "xlocale_private.h"
8 +
9 #include <stdio.h>
10 #include <string.h>
11 #include "local.h"
12 @@ -76,5 +78,28 @@
13 f._lb._base = NULL;
14 f._extra = &ext;
15 INITEXTRA(&f);
16 - return (__svfscanf(&f, fmt, ap));
17 + return (__svfscanf_l(&f, __current_locale(), fmt, ap));
18 +}
19 +
20 +int
21 +vsscanf_l(str, loc, fmt, ap)
22 + const char * __restrict str;
23 + locale_t loc;
24 + const char * __restrict fmt;
25 + __va_list ap;
26 +{
27 + FILE f;
28 + struct __sFILEX ext;
29 +
30 + NORMALIZE_LOCALE(loc);
31 + f._file = -1;
32 + f._flags = __SRD;
33 + f._bf._base = f._p = (unsigned char *)str;
34 + f._bf._size = f._r = strlen(str);
35 + f._read = eofread;
36 + f._ub._base = NULL;
37 + f._lb._base = NULL;
38 + f._extra = &ext;
39 + INITEXTRA(&f);
40 + return (__svfscanf_l(&f, loc, fmt, ap));
41 }