From 86dc3a9ae223b112541b2ce4eee1f5de475b09b1 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Sat, 21 Apr 2012 07:31:27 +0000 Subject: [PATCH] As noted by Peter Jeremy, r234528 only partially fixed the infinite loop bug introduced in r187302. This completes the fix. PR: 167039 MFC after: 3 days --- lib/libc/stdio/fputws.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdio/fputws.c b/lib/libc/stdio/fputws.c index d9dc4dfbf21..fa8d31784e0 100644 --- a/lib/libc/stdio/fputws.c +++ b/lib/libc/stdio/fputws.c @@ -61,8 +61,8 @@ fputws_l(const wchar_t * __restrict ws, FILE * __restrict fp, locale_t locale) uio.uio_iov = &iov; uio.uio_iovcnt = 1; iov.iov_base = buf; + wsp = ws; do { - wsp = ws; nbytes = l->__wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf), &fp->_mbstate); if (nbytes == (size_t)-1)