Don't add integers to void pointers.

This commit is contained in:
Stefan Farfeleder 2004-10-03 15:48:32 +00:00
parent 4e8c80e977
commit 4c86f66f52
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136092
2 changed files with 6 additions and 3 deletions

View file

@ -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;

View file

@ -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 == '<') {