]> git.ipfire.org Git - thirdparty/gcc.git/blame - libiberty/strchr.c
configure.in: Don't use in-tree texinfo, because libiberty must be built before it.
[thirdparty/gcc.git] / libiberty / strchr.c
CommitLineData
6599da04
JM
1/* Portable version of strchr()
2 This function is in the public domain. */
3
4/*
6599da04 5
aaa5f039
DD
6@deftypefn Supplemental char* strchr (const char *@var{s}, int @var{c})
7
8Returns a pointer to the first occurance of the character @var{c} in
9the string @var{s}, or NULL if not found. If @var{c} is itself the
10null character, the results are undefined.
11
12@end deftypefn
6599da04 13
6599da04
JM
14*/
15
16#include <ansidecl.h>
17
18char *
19strchr (s, c)
11a0bb74 20 register const char *s;
6599da04
JM
21 int c;
22{
23 do {
24 if (*s == c)
25 {
26 return (char*)s;
27 }
28 } while (*s++);
29 return (0);
30}