diff options
author | 2016-09-21 04:38:56 +0000 | |
---|---|---|
committer | 2016-09-21 04:38:56 +0000 | |
commit | 3240e6a8f93e9dcb3b95e7fafb9e2b27f13c7c9d (patch) | |
tree | 7368a30a463d94567dfeaa9177978c7039ebf249 /lib/libc/stdio/fgetln.c | |
parent | sync (diff) | |
download | wireguard-openbsd-3240e6a8f93e9dcb3b95e7fafb9e2b27f13c7c9d.tar.xz wireguard-openbsd-3240e6a8f93e9dcb3b95e7fafb9e2b27f13c7c9d.zip |
Delete casts to off_t and size_t that are implied by assignments
or prototypes. Ditto for some of the char* and void* casts too.
verified no change to instructions on ILP32 (i386) and LP64 (amd64)
ok natano@ abluhm@ deraadt@ millert@
Diffstat (limited to 'lib/libc/stdio/fgetln.c')
-rw-r--r-- | lib/libc/stdio/fgetln.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/libc/stdio/fgetln.c b/lib/libc/stdio/fgetln.c index a5ea1b3207e..bdb0c2a5b37 100644 --- a/lib/libc/stdio/fgetln.c +++ b/lib/libc/stdio/fgetln.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fgetln.c,v 1.15 2016/08/25 19:21:33 schwarze Exp $ */ +/* $OpenBSD: fgetln.c,v 1.16 2016/09/21 04:38:56 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -76,7 +76,7 @@ fgetln(FILE *fp, size_t *lenp) goto error; /* look for a newline in the input */ - if ((p = memchr((void *)fp->_p, '\n', fp->_r)) != NULL) { + if ((p = memchr(fp->_p, '\n', fp->_r)) != NULL) { /* * Found one. Flag buffer as modified to keep fseek from * `optimising' a backward seek, in case the user stomps on @@ -112,15 +112,14 @@ fgetln(FILE *fp, size_t *lenp) */ if (__slbexpand(fp, len + OPTIMISTIC)) goto error; - (void)memcpy((void *)(fp->_lb._base + off), (void *)fp->_p, - len - off); + (void)memcpy(fp->_lb._base + off, fp->_p, len - off); off = len; if (__srefill(fp)) { if (fp->_flags & __SEOF) break; goto error; } - if ((p = memchr((void *)fp->_p, '\n', fp->_r)) == NULL) + if ((p = memchr(fp->_p, '\n', fp->_r)) == NULL) continue; /* got it: finish up the line (like code above) */ @@ -129,8 +128,7 @@ fgetln(FILE *fp, size_t *lenp) len += diff; if (__slbexpand(fp, len)) goto error; - (void)memcpy((void *)(fp->_lb._base + off), (void *)fp->_p, - diff); + (void)memcpy(fp->_lb._base + off, fp->_p, diff); fp->_r -= diff; fp->_p = p; break; |