From e77b371fb0fc4e62fa727a340b2e322fa60ebcff Mon Sep 17 00:00:00 2001 From: James Barnett Date: Sun, 6 Oct 2019 15:53:52 +0100 Subject: Add command parsing and echo command --- os/stdlib/stdlib.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'os/stdlib/stdlib.c') 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 -- cgit v1.2.3