aboutsummaryrefslogtreecommitdiffstats
path: root/strchrnul.c
diff options
context:
space:
mode:
Diffstat (limited to 'strchrnul.c')
-rw-r--r--strchrnul.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/strchrnul.c b/strchrnul.c
new file mode 100644
index 0000000..e76978f
--- /dev/null
+++ b/strchrnul.c
@@ -0,0 +1,11 @@
+/* See LICENSE file for copyright and license details. */
+#include "libsimple.h"
+
+
+char *
+libsimple_strchrnul(const char *s_, int c)
+{
+ char *s = *(char **)(void *)&s_;
+ for (; *s && (int)*s != c; s++);
+ return s;
+}