summaryrefslogtreecommitdiffstats
path: root/lib/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/string.c')
-rw-r--r--lib/string.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/string.c b/lib/string.c
index 717b59aa50..7548fd3581 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -208,6 +208,8 @@ int strcmp(const char * cs,const char * ct)
{
register signed char __res;
+ BUG_ON(!cs || !ct);
+
while (1) {
if ((__res = *cs - *ct++) != 0 || !*cs++)
break;
@@ -229,6 +231,8 @@ int strncmp(const char * cs, const char * ct, size_t count)
{
register signed char __res = 0;
+ BUG_ON(!cs || !ct);
+
while (count) {
if ((__res = *cs - *ct++) != 0 || !*cs++)
break;