diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/string.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/string.c b/lib/string.c index e94021c4680..e6e749b80b2 100644 --- a/lib/string.c +++ b/lib/string.c @@ -230,6 +230,14 @@ char * strchr(const char * s, int c) } #endif +const char *strchrnul(const char *s, int c) +{ + for (; *s != (char)c; ++s) + if (*s == '\0') + break; + return s; +} + #ifndef __HAVE_ARCH_STRRCHR /** * strrchr - Find the last occurrence of a character in a string |