fix tolower typecast on CYGWIN, gcc-arm-none-eabi (gnuarmeclipse toolchain) and possible future ports.
This commit is contained in:
parent
3345293ad7
commit
9e667c15c7
@ -3837,18 +3837,19 @@ static int MatchDomainName(const char* pattern, int len, const char* str)
|
||||
|
||||
while (len > 0) {
|
||||
|
||||
p = (char)XTOLOWER(*pattern++);
|
||||
p = (char)XTOLOWER((unsigned char)*pattern++);
|
||||
if (p == 0)
|
||||
break;
|
||||
|
||||
if (p == '*') {
|
||||
while (--len > 0 && (p = (char)XTOLOWER(*pattern++)) == '*')
|
||||
while (--len > 0 &&
|
||||
(p = (char)XTOLOWER((unsigned char)*pattern++)) == '*')
|
||||
;
|
||||
|
||||
if (len == 0)
|
||||
p = '\0';
|
||||
|
||||
while ( (s = (char)XTOLOWER(*str)) != '\0') {
|
||||
while ( (s = (char)XTOLOWER((unsigned char) *str)) != '\0') {
|
||||
if (s == p)
|
||||
break;
|
||||
if (s == '.')
|
||||
@ -3857,7 +3858,7 @@ static int MatchDomainName(const char* pattern, int len, const char* str)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (p != (char)XTOLOWER(*str))
|
||||
if (p != (char)XTOLOWER((unsigned char) *str))
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3238,7 +3238,8 @@ static int MatchBaseName(int type, const char* name, int nameSz,
|
||||
}
|
||||
|
||||
while (nameSz > 0) {
|
||||
if (XTOLOWER(*name++) != XTOLOWER(*base++))
|
||||
if (XTOLOWER((unsigned char)*name++) !=
|
||||
XTOLOWER((unsigned char)*base++))
|
||||
return 0;
|
||||
nameSz--;
|
||||
}
|
||||
|
@ -217,11 +217,6 @@
|
||||
#define XISALPHA(c) isalpha((c))
|
||||
#endif
|
||||
/* needed by wolfSSL_check_domain_name() */
|
||||
#ifdef __CYGWIN__
|
||||
/* Cygwin uses a macro version of tolower() by default, use the
|
||||
* function version. */
|
||||
#undef tolower
|
||||
#endif
|
||||
#define XTOLOWER(c) tolower((c))
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user