projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date and time created 91/04/12 13:40:31 by bostic
[unix-history]
/
usr
/
src
/
lib
/
libc
/
string
/
strchr.c
diff --git
a/usr/src/lib/libc/string/strchr.c
b/usr/src/lib/libc/string/strchr.c
index
24c9b31
..
a8e60c9
100644
(file)
--- a/
usr/src/lib/libc/string/strchr.c
+++ b/
usr/src/lib/libc/string/strchr.c
@@
-1,23
+1,19
@@
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)strchr.c 5.2 (Berkeley) 86/03/09";
-#endif LIBC_SCCS and not lint
-
/*
/*
- *
Return the ptr in sp at which the character c appears;
- *
NULL if not found
+ *
Copyright (c) 1988 Regents of the University of California.
+ *
All rights reserved.
*
*
- *
this routine is just "index" renamed.
+ *
%sccs.include.redist.c%
*/
*/
-#define NULL 0
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)strchr.c 5.6 (Berkeley) %G%";
+#endif /* LIBC_SCCS and not lint */
+
+#include <string.h>
char *
char *
-strchr(
sp, c
)
-
register char *sp, c
;
+strchr(
p, ch
)
+
char *p, ch
;
{
{
- do {
- if (*sp == c)
- return(sp);
- } while (*sp++);
- return(NULL);
+ return(index(p, ch));
}
}