summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdio/fgetws.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/stdio/fgetws.c b/lib/libc/stdio/fgetws.c
index 9b7075d..b6ef01e 100644
--- a/lib/libc/stdio/fgetws.c
+++ b/lib/libc/stdio/fgetws.c
@@ -74,7 +74,8 @@ fgetws(wchar_t * __restrict ws, int n, FILE * __restrict fp)
* after the null.
*/
nconv++;
- src = memchr(fp->_p, '\0', fp->_r) + 1;
+ src = memchr(fp->_p, '\0', fp->_r);
+ src++;
}
fp->_r -= (unsigned char *)src - fp->_p;
fp->_p = (unsigned char *)src;
OpenPOWER on IntegriCloud