summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/stdio.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2016-09-21 04:38:56 +0000
committerguenther <guenther@openbsd.org>2016-09-21 04:38:56 +0000
commit3240e6a8f93e9dcb3b95e7fafb9e2b27f13c7c9d (patch)
tree7368a30a463d94567dfeaa9177978c7039ebf249 /lib/libc/stdio/stdio.c
parentsync (diff)
downloadwireguard-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/stdio.c')
-rw-r--r--lib/libc/stdio/stdio.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c
index a4a27b53b64..fe28f00918c 100644
--- a/lib/libc/stdio/stdio.c
+++ b/lib/libc/stdio/stdio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdio.c,v 1.9 2005/08/08 08:05:36 espie Exp $ */
+/* $OpenBSD: stdio.c,v 1.10 2016/09/21 04:38:56 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -31,9 +31,8 @@
* SUCH DAMAGE.
*/
-#include <fcntl.h>
-#include <unistd.h>
#include <stdio.h>
+#include <unistd.h>
#include "local.h"
/*
@@ -61,7 +60,7 @@ __swrite(void *cookie, const char *buf, int n)
FILE *fp = cookie;
if (fp->_flags & __SAPP)
- (void) lseek(fp->_file, (off_t)0, SEEK_END);
+ (void) lseek(fp->_file, 0, SEEK_END);
fp->_flags &= ~__SOFF; /* in case FAPPEND mode is set */
return (write(fp->_file, buf, n));
}
@@ -72,8 +71,8 @@ __sseek(void *cookie, fpos_t offset, int whence)
FILE *fp = cookie;
off_t ret;
- ret = lseek(fp->_file, (off_t)offset, whence);
- if (ret == (off_t)-1)
+ ret = lseek(fp->_file, offset, whence);
+ if (ret == -1)
fp->_flags &= ~__SOFF;
else {
fp->_flags |= __SOFF;