]> git.ipfire.org Git - thirdparty/gcc.git/blame - libiberty/strchr.c
Revert "RISC-V: Support highest overlap for wv instructions"
[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
e922f978 8Returns a pointer to the first occurrence of the character @var{c} in
7f8fa05d 9the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the
aaa5f039
DD
10null character, the results are undefined.
11
12@end deftypefn
6599da04 13
6599da04
JM
14*/
15
16#include <ansidecl.h>
17
18char *
885f2199 19strchr (register const char *s, int c)
6599da04
JM
20{
21 do {
22 if (*s == c)
23 {
24 return (char*)s;
25 }
26 } while (*s++);
27 return (0);
28}