aboutsummaryrefslogtreecommitdiffstats
path: root/src/string_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_utils.h')
-rw-r--r--src/string_utils.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/string_utils.h b/src/string_utils.h
index 2517b270..3337f012 100644
--- a/src/string_utils.h
+++ b/src/string_utils.h
@@ -67,7 +67,7 @@ is_utf8_continuation(const uint8_t c)
}
static inline bool
-is_space(const char c)
+is_space(const int c)
{
switch (c) {
case ' ':
@@ -102,16 +102,16 @@ hex_digit_value(const uint8_t c)
}
static inline char
-serd_to_upper(const char c)
+serd_to_lower(const char c)
{
- return (char)((c >= 'a' && c <= 'z') ? c - 32 : c);
+ return (char)((c >= 'A' && c <= 'Z') ? c + 32 : c);
}
static inline int
serd_strncasecmp(const char* s1, const char* s2, size_t n)
{
for (; n > 0 && *s2; s1++, s2++, --n) {
- if (serd_to_upper(*s1) != serd_to_upper(*s2)) {
+ if (serd_to_lower(*s1) != serd_to_lower(*s2)) {
return (*s1 < *s2) ? -1 : +1;
}
}