projects
/
rpikern
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
serial experiment works
[rpikern]
/
src
/
libc
/
string.c
diff --git
a/src/libc/string.c
b/src/libc/string.c
index
8431648
..
9ffb5ec
100644
(file)
--- a/
src/libc/string.c
+++ b/
src/libc/string.c
@@
-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;
+}