summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/string.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/string.c b/lib/string.c
index e94021c..e6e749b 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