Commit | Line | Data |
---|---|---|
117fa619 | 1 | /* |
6c6b7ee3 KB |
2 | * Copyright (c) 1988 Regents of the University of California. |
3 | * All rights reserved. | |
117fa619 | 4 | * |
6c6b7ee3 KB |
5 | * Redistribution and use in source and binary forms are permitted |
6 | * provided that this notice is preserved and that due credit is given | |
7 | * to the University of California at Berkeley. The name of the University | |
8 | * may not be used to endorse or promote products derived from this | |
9 | * software without specific written prior permission. This software | |
10 | * is provided ``as is'' without express or implied warranty. | |
117fa619 RE |
11 | */ |
12 | ||
6c6b7ee3 KB |
13 | #if defined(LIBC_SCCS) && !defined(lint) |
14 | static char sccsid[] = "@(#)strchr.c 5.3 (Berkeley) %G%"; | |
15 | #endif /* LIBC_SCCS and not lint */ | |
16 | ||
17 | #ifdef notdef | |
18 | static char sccsid[] = "@(#)index.c 5.3 (Berkeley) 6/2/88"; | |
19 | #endif | |
20 | ||
21 | #include <stdio.h> | |
117fa619 RE |
22 | |
23 | char * | |
6c6b7ee3 KB |
24 | strchr(p, ch) |
25 | register char *p, ch; | |
117fa619 | 26 | { |
6c6b7ee3 KB |
27 | for (;; ++p) { |
28 | if (*p == ch) | |
29 | return(p); | |
30 | if (!*p) | |
31 | return((char *)NULL); | |
32 | } | |
33 | /* NOTREACHED */ | |
117fa619 | 34 | } |