From 177628ce757cf1a3f7d4b9a70dc4682d22e50ebc Mon Sep 17 00:00:00 2001 From: David Schultz Date: Sat, 21 Apr 2012 06:08:02 +0000 Subject: [PATCH] Fix a bug introduced in r187302 that was causing fputws() to enter an infinite loop pretty much unconditionally. It's remarkable that the patch that introduced the bug was never tested, but even more remarkable that nobody noticed for over two years. 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 a318e2d8acd..d9dc4dfbf21 100644 --- a/lib/libc/stdio/fputws.c +++ b/lib/libc/stdio/fputws.c @@ -70,7 +70,7 @@ fputws_l(const wchar_t * __restrict ws, FILE * __restrict fp, locale_t locale) iov.iov_len = uio.uio_resid = nbytes; if (__sfvwrite(fp, &uio) != 0) goto error; - } while (ws != NULL); + } while (wsp != NULL); FUNLOCKFILE(fp); return (0);