diff options
Diffstat (limited to 'lib/libc/stdio/fputws.c')
-rw-r--r-- | lib/libc/stdio/fputws.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdio/fputws.c b/lib/libc/stdio/fputws.c index 7397411..b4462b7 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; |