summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/memset.c
diff options
context:
space:
mode:
authorray <ray@openbsd.org>2008-03-15 21:40:39 +0000
committerray <ray@openbsd.org>2008-03-15 21:40:39 +0000
commita9b24e96e41d51fe9a0d7280fef308f49288b5e8 (patch)
treeda5600586e3d246c903d2f8e0dc797a4a29e0334 /lib/libc/string/memset.c
parentIn statclock(), fix local index type in the profiling code. Avoids (diff)
downloadwireguard-openbsd-a9b24e96e41d51fe9a0d7280fef308f49288b5e8.tar.xz
wireguard-openbsd-a9b24e96e41d51fe9a0d7280fef308f49288b5e8.zip
Convert c to unsigned char, like it says in the manual. Also add
cast to make it explicit. Found by lint, OK millert.
Diffstat (limited to 'lib/libc/string/memset.c')
-rw-r--r--lib/libc/string/memset.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/string/memset.c b/lib/libc/string/memset.c
index db32866a0e4..61709c139de 100644
--- a/lib/libc/string/memset.c
+++ b/lib/libc/string/memset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memset.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: memset.c,v 1.6 2008/03/15 21:40:39 ray Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -36,12 +36,11 @@
void *
memset(void *dst, int c, size_t n)
{
-
if (n != 0) {
- char *d = dst;
+ unsigned char *d = dst;
do
- *d++ = c;
+ *d++ = (unsigned char)c;
while (--n != 0);
}
return (dst);