summaryrefslogtreecommitdiffstats
path: root/lib/strcmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/strcmp.c')
-rw-r--r--lib/strcmp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/strcmp.c b/lib/strcmp.c
new file mode 100644
index 0000000..da6a51a
--- /dev/null
+++ b/lib/strcmp.c
@@ -0,0 +1,8 @@
+#include "string.h"
+
+int
+strcmp(const char *s1, const char *s2)
+{
+ while(*s1 && *s2 && *(s1++) == *(s2++));
+ return *s2 - *s1;
+}