diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-09-28 22:25:29 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-09-28 22:25:29 +0000 |
commit | 0ae8dceaebe3659ee0c3352c08125f403e77ebca (patch) | |
tree | 5085c389f09da78182b899d19fe1068b619a69dd /lib/string.c | |
parent | 273767781288c35c9d679e908672b9996cda4c34 (diff) |
Merge with 2.3.10.
Diffstat (limited to 'lib/string.c')
-rw-r--r-- | lib/string.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/string.c b/lib/string.c index ad6db47fa..d63f624d9 100644 --- a/lib/string.c +++ b/lib/string.c @@ -363,3 +363,17 @@ char * strstr(const char * s1,const char * s2) return NULL; } #endif + +#ifndef __HAVE_ARCH_MEMCHR +void *memchr(const void *s, int c, size_t n) +{ + unsigned char *p = s; + while (n-- != 0) { + if ((unsigned char)c == *p++) { + return p-1; + } + } + return NULL; +} + +#endif |