diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-01-15 18:53:52 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-01-15 18:53:52 +0000 |
| commit | f27b1c064cce031591086617b72c704502a46782 (patch) | |
| tree | fca663953f11d103ba29a50566b47a332378986c /lib/libc/stdio | |
| parent | 16a296f7c9d92cb9de04b35ecdc27f60cc9a9b25 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio')
| -rw-r--r-- | lib/libc/stdio/fputws.c | 4 | ||||
| -rw-r--r-- | lib/libc/stdio/vswscanf.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/stdio/fputws.c b/lib/libc/stdio/fputws.c index 73974113253a..b4462b744197 100644 --- a/lib/libc/stdio/fputws.c +++ b/lib/libc/stdio/fputws.c @@ -45,6 +45,7 @@ fputws(const wchar_t * __restrict ws, FILE * __restrict fp) char buf[BUFSIZ]; struct __suio uio; struct __siov iov; + const wchar_t *wsp; FLOCKFILE(fp); ORIENT(fp, 1); @@ -54,7 +55,8 @@ fputws(const wchar_t * __restrict ws, FILE * __restrict fp) uio.uio_iovcnt = 1; iov.iov_base = buf; do { - nbytes = __wcsnrtombs(buf, &ws, SIZE_T_MAX, sizeof(buf), + wsp = ws; + nbytes = __wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf), &fp->_mbstate); if (nbytes == (size_t)-1) goto error; diff --git a/lib/libc/stdio/vswscanf.c b/lib/libc/stdio/vswscanf.c index 67bfb47b68d4..8a70d446337b 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); } |
