Browse Source

K&R promotion is not the whole story. Make things explicit.

OPENBSD_3_0
espie 23 years ago
parent
commit
aecf1306d9
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/lib/libc/string/memchr.c

+ 2
- 2
src/lib/libc/string/memchr.c View File

@ -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);
} }


Loading…
Cancel
Save