summaryrefslogtreecommitdiff
path: root/libkern/strchr-spim.c
diff options
context:
space:
mode:
Diffstat (limited to 'libkern/strchr-spim.c')
-rw-r--r--libkern/strchr-spim.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libkern/strchr-spim.c b/libkern/strchr-spim.c
new file mode 100644
index 00000000..1d4d425c
--- /dev/null
+++ b/libkern/strchr-spim.c
@@ -0,0 +1,18 @@
+#include <lib9.h>
+
+char*
+strchr(char *s, int c)
+{
+ char c1;
+
+ if(c == 0) {
+ while(*s++)
+ ;
+ return s-1;
+ }
+
+ while(c1 = *s++)
+ if(c1 == c)
+ return s-1;
+ return 0;
+}