summaryrefslogtreecommitdiff
path: root/lib/string/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/string/string.c')
-rw-r--r--lib/string/string.c8
1 files changed, 6 insertions, 2 deletions
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;
+ }
}
+
}