diff options
author | jdp <jdp@FreeBSD.org> | 1998-03-01 22:58:51 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1998-03-01 22:58:51 +0000 |
commit | 2cbd0590cd191c81b59e94970f4c40c371f9e415 (patch) | |
tree | b7676f996414b979dcbb7de92a3e86b97320d023 /contrib/binutils/libiberty/strchr.c | |
download | FreeBSD-src-2cbd0590cd191c81b59e94970f4c40c371f9e415.zip FreeBSD-src-2cbd0590cd191c81b59e94970f4c40c371f9e415.tar.gz |
Initial import of GNU binutils version 2.8.1. Believe it or not,
this is heavily stripped down.
Diffstat (limited to 'contrib/binutils/libiberty/strchr.c')
-rw-r--r-- | contrib/binutils/libiberty/strchr.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/contrib/binutils/libiberty/strchr.c b/contrib/binutils/libiberty/strchr.c new file mode 100644 index 0000000..22976ce --- /dev/null +++ b/contrib/binutils/libiberty/strchr.c @@ -0,0 +1,34 @@ +/* Portable version of strchr() + This function is in the public domain. */ + +/* +NAME + strchr -- return pointer to first occurance of a character + +SYNOPSIS + char *strchr (const char *s, int c) + +DESCRIPTION + Returns a pointer to the first occurance of character C in + string S, or a NULL pointer if no occurance is found. + +BUGS + Behavior when character is the null character is implementation + dependent. +*/ + +#include <ansidecl.h> + +char * +strchr (s, c) + register CONST char *s; + int c; +{ + do { + if (*s == c) + { + return (char*)s; + } + } while (*s++); + return (0); +} |