]> pd.if.org Git - zos/blobdiff - klib/strcmp.c
klib and makefile
[zos] / klib / strcmp.c
diff --git a/klib/strcmp.c b/klib/strcmp.c
new file mode 100644 (file)
index 0000000..6d46c95
--- /dev/null
@@ -0,0 +1,9 @@
+#include <string.h>
+
+int strcmp(const char *s1, const char *s2) {
+       while ( *s1 && (*s1 == *s2) ) {
+               ++s1;
+               ++s2;
+       }
+       return *(unsigned char *)s1 - *(unsigned char *)s2;
+}