summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-08-06 17:00:09 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-08-06 17:00:09 +0000
commit91f18ef9289c9e48c35ee5df3340022ceab54149 (patch)
tree94bed82daa80b06b78e1ee71d9f301f3d0a2055a /lib/libc
parentddabcdb43335f554ea36613638473f30a3a6c809 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/fgetwln.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/stdio/fgetwln.c b/lib/libc/stdio/fgetwln.c
index a55932172fa5..1a1ad2ddeaa0 100644
--- a/lib/libc/stdio/fgetwln.c
+++ b/lib/libc/stdio/fgetwln.c
@@ -46,11 +46,10 @@ fgetwln(FILE * __restrict fp, size_t *lenp)
len = 0;
while ((wc = __fgetwc(fp)) != WEOF) {
#define GROW 512
- len++;
if (len * sizeof(wchar_t) >= fp->_lb._size &&
__slbexpand(fp, (len + GROW) * sizeof(wchar_t)))
goto error;
- *((wchar_t *)fp->_lb._base + len) = wc;
+ *((wchar_t *)fp->_lb._base + len++) = wc;
if (wc == L'\n')
break;
}