Get rid of ctype dependencies

This commit is contained in:
Sergey Lyubka committed 2022-02-22 20:20:56 +00:00
1 parent 113abc71d4
commit 393dad97e0
6 files changed
+57 -30

No files matched your search

+3 -1
View File
@@ -12,7 +12,9 @@ struct mg_str mg_str_n(const char *s, size_t n) {
}
int mg_lower(const char *s) {
return tolower(*(const unsigned char *) s);
int c = *s;
if (c >= 'A' && c <= 'Z') c += 'a' - 'A';
return c;
}
int mg_ncasecmp(const char *s1, const char *s2, size_t len) {