|
@ -35,7 +35,7 @@ |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
#if defined(LIBC_SCCS) && !defined(lint) |
|
|
#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 */ |
|
|
#endif /* LIBC_SCCS and not lint */ |
|
|
|
|
|
|
|
|
#include <string.h> |
|
|
#include <string.h> |
|
@ -50,7 +50,7 @@ memchr(s, c, n) |
|
|
const unsigned char *p = s; |
|
|
const unsigned char *p = s; |
|
|
|
|
|
|
|
|
do { |
|
|
do { |
|
|
if (*p++ == c) |
|
|
|
|
|
|
|
|
if (*p++ == (unsigned char)c) |
|
|
return ((void *)(p - 1)); |
|
|
return ((void *)(p - 1)); |
|
|
} while (--n != 0); |
|
|
} while (--n != 0); |
|
|
} |
|
|
} |
|
|