summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/stdio/fgetws.c3
-rw-r--r--sbin/dmesg/dmesg.c6
2 files changed, 6 insertions, 3 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;
diff --git a/sbin/dmesg/dmesg.c b/sbin/dmesg/dmesg.c
index 12789fd..d24addd 100644
--- a/sbin/dmesg/dmesg.c
+++ b/sbin/dmesg/dmesg.c
@@ -166,10 +166,12 @@ main(int argc, char *argv[])
p++;
} else if (!all) {
/* Skip the first line, since it is probably incomplete. */
- p = memchr(p, '\n', ep - p) + 1;
+ p = memchr(p, '\n', ep - p);
+ p++;
}
for (; p < ep; p = nextp) {
- nextp = memchr(p, '\n', ep - p) + 1;
+ nextp = memchr(p, '\n', ep - p);
+ nextp++;
/* Skip ^<[0-9]+> syslog sequences. */
if (*p == '<') {
OpenPOWER on IntegriCloud