Browse Source

Convert to ANSI function headers and make 'ch' argument int, not char.

Noticed by deraadt@
OPENBSD_3_2
millert 22 years ago
parent
commit
3a97f67ea7
2 changed files with 6 additions and 8 deletions
  1. +3
    -4
      src/lib/libc/string/index.c
  2. +3
    -4
      src/lib/libc/string/rindex.c

+ 3
- 4
src/lib/libc/string/index.c View File

@ -32,18 +32,17 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: index.c,v 1.2 1996/08/19 08:34:02 tholo Exp $";
static char *rcsid = "$OpenBSD: index.c,v 1.3 2002/07/24 04:16:01 millert Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <string.h> #include <string.h>
char * char *
#ifdef STRCHR #ifdef STRCHR
strchr(p, ch)
strchr(const char *p, int ch)
#else #else
index(p, ch)
index(const char *p, int ch)
#endif #endif
register const char *p, ch;
{ {
for (;; ++p) { for (;; ++p) {
if (*p == ch) if (*p == ch)


+ 3
- 4
src/lib/libc/string/rindex.c View File

@ -32,18 +32,17 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: rindex.c,v 1.2 1996/08/19 08:34:08 tholo Exp $";
static char *rcsid = "$OpenBSD: rindex.c,v 1.3 2002/07/24 04:16:01 millert Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <string.h> #include <string.h>
char * char *
#ifdef STRRCHR #ifdef STRRCHR
strrchr(p, ch)
strrchr(const char *p, int ch)
#else #else
rindex(p, ch)
rindex(const char *p, int ch)
#endif #endif
register const char *p, ch;
{ {
register char *save; register char *save;


Loading…
Cancel
Save