aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sbi/sbi_string.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sbi/sbi_string.c b/lib/sbi/sbi_string.c
index 7805ba4..c87bce9 100644
--- a/lib/sbi/sbi_string.c
+++ b/lib/sbi/sbi_string.c
@@ -33,6 +33,10 @@ int sbi_strncmp(const char *a, const char *b, size_t count)
for (; count > 0 && *a == *b && *a != '\0'; a++, b++, count--)
;
+ /* No difference till the end */
+ if (!count)
+ return 0;
+
return *a - *b;
}