diff --git a/charset/localenc.c b/charset/localenc.c index 4d81f50f..22088877 100644 --- a/charset/localenc.c +++ b/charset/localenc.c @@ -102,7 +102,7 @@ int charset_from_localenc(const char *name) p = name; q = localencs[i].name; while (*p || *q) { - if (tolower(*p) != tolower(*q)) + if (tolower((unsigned char)*p) != tolower((unsigned char)*q)) break; p++; q++; } diff --git a/charset/mimeenc.c b/charset/mimeenc.c index 437781f6..93ad89e7 100644 --- a/charset/mimeenc.c +++ b/charset/mimeenc.c @@ -202,7 +202,7 @@ int charset_from_mimeenc(const char *name) p = name; q = mimeencs[i].name; while (*p || *q) { - if (tolower(*p) != tolower(*q)) + if (tolower((unsigned char)*p) != tolower((unsigned char)*q)) break; p++; q++; } diff --git a/charset/xenc.c b/charset/xenc.c index b6532f29..11787978 100644 --- a/charset/xenc.c +++ b/charset/xenc.c @@ -81,7 +81,7 @@ int charset_from_xenc(const char *name) p = name; q = xencs[i].name; while (*p || *q) { - if (tolower(*p) != tolower(*q)) + if (tolower((unsigned char)*p) != tolower((unsigned char)*q)) break; p++; q++; }