summaryrefslogtreecommitdiffstats
path: root/replace/strchrnul.c
diff options
context:
space:
mode:
Diffstat (limited to 'replace/strchrnul.c')
-rw-r--r--replace/strchrnul.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/replace/strchrnul.c b/replace/strchrnul.c
new file mode 100644
index 0000000..d1be6df
--- /dev/null
+++ b/replace/strchrnul.c
@@ -0,0 +1,15 @@
+#include <crm_internal.h>
+/* Borrowed from gnulib's strchrnul.c under GLPv2+ */
+
+#include <string.h>
+/* Find the first occurrence of C in S or the final NUL byte. */
+char *
+strchrnul(const char *s, int c_in)
+{
+ char c = c_in;
+
+ while (*s && (*s != c))
+ s++;
+
+ return (char *)s;
+}