aboutsummaryrefslogtreecommitdiff
path: root/gnu/libexec/uucp/libuucp/strchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/libexec/uucp/libuucp/strchr.c')
-rw-r--r--gnu/libexec/uucp/libuucp/strchr.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gnu/libexec/uucp/libuucp/strchr.c b/gnu/libexec/uucp/libuucp/strchr.c
new file mode 100644
index 000000000000..ca8d8e9b1bdf
--- /dev/null
+++ b/gnu/libexec/uucp/libuucp/strchr.c
@@ -0,0 +1,16 @@
+/* strchr.c
+ Look for a character in a string. This works for a null byte. */
+
+#include "uucp.h"
+
+char *
+strchr (z, b)
+ const char *z;
+ int b;
+{
+ b = (char) b;
+ while (*z != b)
+ if (*z++ == '\0')
+ return NULL;
+ return (char *) z;
+}