diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-01-15 18:53:52 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-01-15 18:53:52 +0000 |
commit | 68edecb54458a58111725209d5eefba8f2ea01aa (patch) | |
tree | fca663953f11d103ba29a50566b47a332378986c /lib/libc/stdio/vswscanf.c | |
parent | 2d3842287a220a3cdfb3ebdc2a413e5ed57798dd (diff) | |
download | FreeBSD-src-68edecb54458a58111725209d5eefba8f2ea01aa.zip FreeBSD-src-68edecb54458a58111725209d5eefba8f2ea01aa.tar.gz |
Introduce a local variable and use it instead of passed in parameter
to get rid of restrict qualifier discarding. This lets libc compile
cleanly in gnu99 mode.
Suggested by: kib, christoph.mallon at gmx.de
Approved by: kib (mentor)
Diffstat (limited to 'lib/libc/stdio/vswscanf.c')
-rw-r--r-- | lib/libc/stdio/vswscanf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdio/vswscanf.c b/lib/libc/stdio/vswscanf.c index 67bfb47..8a70d44 100644 --- a/lib/libc/stdio/vswscanf.c +++ b/lib/libc/stdio/vswscanf.c @@ -66,6 +66,7 @@ vswscanf(const wchar_t * __restrict str, const wchar_t * __restrict fmt, char *mbstr; size_t mlen; int r; + const wchar_t *strp; /* * XXX Convert the wide character string to multibyte, which @@ -74,7 +75,8 @@ vswscanf(const wchar_t * __restrict str, const wchar_t * __restrict fmt, if ((mbstr = malloc(wcslen(str) * MB_CUR_MAX + 1)) == NULL) return (EOF); mbs = initial; - if ((mlen = wcsrtombs(mbstr, &str, SIZE_T_MAX, &mbs)) == (size_t)-1) { + strp = str; + if ((mlen = wcsrtombs(mbstr, &strp, SIZE_T_MAX, &mbs)) == (size_t)-1) { free(mbstr); return (EOF); } |