diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-08-07 00:38:34 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-08-07 00:38:34 +0000 |
commit | 6199f15e3e0651e8399ad97e919a96d69d128ee2 (patch) | |
tree | cde8dbb44682b9bafafa3ec82a63352162d5cf59 /sys/lib/libkern/memchr.c | |
parent | f8b1d50fcd985a3171e1d491c63c553aff62c2a7 (diff) |
ansi and some missing protos
Diffstat (limited to 'sys/lib/libkern/memchr.c')
-rw-r--r-- | sys/lib/libkern/memchr.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/lib/libkern/memchr.c b/sys/lib/libkern/memchr.c index fe4a197b854..d5d1537ff1f 100644 --- a/sys/lib/libkern/memchr.c +++ b/sys/lib/libkern/memchr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memchr.c,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: memchr.c,v 1.4 2004/08/07 00:38:32 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -45,16 +45,13 @@ static char *rcsid = "$NetBSD: memchr.c,v 1.2 1997/10/24 18:10:30 mjacob Exp $"; #endif void * -memchr(s, c, n) - const void *s; - register unsigned char c; - register size_t n; +memchr(const void *s, int c, size_t n) { if (n != 0) { - register const unsigned char *p = s; + const unsigned char *p = s; do { - if (*p++ == c) + if (*p++ == (unsigned char)c) return ((void *)(p - 1)); } while (--n != 0); } |