summaryrefslogtreecommitdiff
path: root/prism/util/pm_strncasecmp.c
diff options
context:
space:
mode:
-rw-r--r--prism/util/pm_strncasecmp.c14
1 files changed, 13 insertions, 1 deletions
@@ -1,6 +1,18 @@
#include "prism/util/pm_strncasecmp.h"
/**
* Compare two strings, ignoring case, up to the given length. Returns 0 if the
* strings are equal, a negative number if string1 is less than string2, or a
* positive number if string1 is greater than string2.
@@ -16,7 +28,7 @@ pm_strncasecmp(const uint8_t *string1, const uint8_t *string2, size_t length) {
while (offset < length && string1[offset] != '\0') {
if (string2[offset] == '\0') return string1[offset];
- if ((difference = tolower(string1[offset]) - tolower(string2[offset])) != 0) return difference;
offset++;
}