git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: shell and signal demo as loadable user executable
[lunaix-os.git]
/
lunaix-os
/
usr
/
libc
/
string.c
diff --git
a/lunaix-os/usr/libc/string.c
b/lunaix-os/usr/libc/string.c
index 280cbbe3c8b18fea2440d3010293a1aa3f3acfd6..726437c15a27be883ee4791aed3af876db1c9965 100644
(file)
--- a/
lunaix-os/usr/libc/string.c
+++ b/
lunaix-os/usr/libc/string.c
@@
-55,3
+55,13
@@
strcpy(char* dest, const char* src)
dest[i] = '\0';
return dest;
}
dest[i] = '\0';
return dest;
}
+
+int
+strcmp(const char* a, const char* b)
+{
+ while (*a && *a == *b) {
+ a++;
+ b++;
+ }
+ return *a - *b;
+}
\ No newline at end of file