From 4ce638eb3a5bdefc0301ab39331ba7b059904406 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Wed, 14 May 2014 20:50:32 +0300 Subject: Length check is fragile and breaking behaviour. --- lib/util.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/util.c b/lib/util.c index 2ace7f7..a47ff8d 100644 --- a/lib/util.c +++ b/lib/util.c @@ -57,12 +57,7 @@ size_t _bmStripToken(char *string, const char *token, size_t *outNext) */ int _bmStrupcmp(const char *hay, const char *needle) { - size_t len, len2; - - if ((len = strlen(hay)) != (len2 = strlen(needle))) - return hay[len] - needle[len2]; - - return _bmStrnupcmp(hay, needle, len); + return _bmStrnupcmp(hay, needle, strlen(hay)); } /** -- cgit v1.2.3-70-g09d2