From 3983a157056f10651f120cf39c5d3637aa956903 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Fri, 17 Oct 2014 01:00:27 +0200 Subject: added simple syscall interface --- lib/string/string.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/string/string.c b/lib/string/string.c index bdd92c9..9f58c43 100644 --- a/lib/string/string.c +++ b/lib/string/string.c @@ -1,6 +1,5 @@ #include "lib/bool/bool.h" - //length 0 for null terminated strings; bool strcmp(char *str1, char *str2, int length) { @@ -11,6 +10,11 @@ bool strcmp(char *str1, char *str2, int length) i++; if(i==length) return true; - if(length==0&&str1[i]==0&&str2[i]==0) return true; + if(str1[i]==0||str2[i]==0) + { + if(str1[i]==str2[i])return true; + return false; + } } + } -- cgit v1.2.3