summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2001-09-07 08:09:31 +0000
committerespie <espie@openbsd.org>2001-09-07 08:09:31 +0000
commit695260a9500e8f7b6ee81410c5659cb88f7094e8 (patch)
tree55100328619e370f2d6d53b18b462fe888239c1f
parentSanity check length of -u argument to avoid truncation later on. (diff)
downloadwireguard-openbsd-695260a9500e8f7b6ee81410c5659cb88f7094e8.tar.xz
wireguard-openbsd-695260a9500e8f7b6ee81410c5659cb88f7094e8.zip
K&R promotion is not the whole story. Make things explicit.
-rw-r--r--lib/libc/string/memchr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/string/memchr.c b/lib/libc/string/memchr.c
index 8ae05bbef3d..d605d4734f2 100644
--- a/lib/libc/string/memchr.c
+++ b/lib/libc/string/memchr.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: memchr.c,v 1.3 1999/11/14 20:28:24 espie Exp $";
+static char *rcsid = "$OpenBSD: memchr.c,v 1.4 2001/09/07 08:09:31 espie Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@@ -50,7 +50,7 @@ memchr(s, c, n)
const unsigned char *p = s;
do {
- if (*p++ == c)
+ if (*p++ == (unsigned char)c)
return ((void *)(p - 1));
} while (--n != 0);
}