You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
528 B

/* Portable version of strchr()
This function is in the public domain. */
/*
25 years ago
@deftypefn Supplemental char* strchr (const char *@var{s}, int @var{c})
25 years ago
Returns a pointer to the first occurrence of the character @var{c} in
25 years ago
the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the
25 years ago
null character, the results are undefined.
@end deftypefn
*/
#include <ansidecl.h>
char *
22 years ago
strchr (register const char *s, int c)
{
do {
if (*s == c)
{
return (char*)s;
}
} while (*s++);
return (0);
}