serial experiment works
[rpikern] / src / libc / string.c
index 8431648..9ffb5ec 100644 (file)
@@ -18,3 +18,17 @@ void *memcpy(void *dest, void *src, int size)
        }
        return dest;
 }
+
+int strcmp(const char *a, const char *b)
+{
+       while(*a && *a == *b) {
+               a++;
+               b++;
+       }
+
+       if(!*a && !*b) return 0;
+
+       if(!*a) return -1;
+       if(!*b) return 1;
+       return *a - *b > 0 ? 1 : -1;
+}