* ldlang.c (print_padding_statement): Cast size_t to bfd_vma
[deliverable/binutils-gdb.git] / libiberty / strchr.c
CommitLineData
252b5132
RH
1/* Portable version of strchr()
2 This function is in the public domain. */
3
4/*
252b5132 5
39423523
DD
6@deftypefn Supplemental char* strchr (const char *@var{s}, int @var{c})
7
fa9f0e33 8Returns a pointer to the first occurrence of the character @var{c} in
99b58139 9the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the
39423523
DD
10null character, the results are undefined.
11
12@end deftypefn
252b5132 13
252b5132
RH
14*/
15
16#include <ansidecl.h>
17
18char *
19strchr (s, c)
20 register const char *s;
21 int c;
22{
23 do {
24 if (*s == c)
25 {
26 return (char*)s;
27 }
28 } while (*s++);
29 return (0);
30}
This page took 0.199841 seconds and 4 git commands to generate.