From f3f8ad79f64bcb2e92d92cfd6a77a532d50b8ca9 Mon Sep 17 00:00:00 2001 From: stefanf Date: Sun, 3 Oct 2004 15:48:32 +0000 Subject: Don't add integers to void pointers. --- lib/libc/stdio/fgetws.c | 3 ++- sbin/dmesg/dmesg.c | 6 ++++-- 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 == '<') { -- cgit v1.1