aboutsummaryrefslogtreecommitdiff
path: root/os/stdlib/stdlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/stdlib/stdlib.c')
-rw-r--r--os/stdlib/stdlib.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/os/stdlib/stdlib.c b/os/stdlib/stdlib.c
index 465e978..bdb2242 100644
--- a/os/stdlib/stdlib.c
+++ b/os/stdlib/stdlib.c
@@ -18,4 +18,18 @@ char* int_to_str(int i)
*--p = '-';
}
return p;
+}
+
+
+int strcmp(const char *str1, const char *str2)
+{
+ while(*str1){
+ if (*str1 != *str2) {
+ break;
+ }
+ str1++;
+ str2++;
+ }
+
+ return *(const unsigned char*)str1 - *(const unsigned char*)str2;
} \ No newline at end of file