From: Willem Toorop Date: Wed, 24 Jul 2019 13:30:11 +0000 (-0400) Subject: Convert argument of to_lower() and is_digit() to unsigned char X-Git-Tag: release-1.7.1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acb6081896d0f761f2283b8e895a62d68802719e;p=thirdparty%2Fldns.git Convert argument of to_lower() and is_digit() to unsigned char --- diff --git a/examples/ldns-dpa.c b/examples/ldns-dpa.c index 1f080e6d..46d8f9ad 100644 --- a/examples/ldns-dpa.c +++ b/examples/ldns-dpa.c @@ -987,10 +987,10 @@ match_str(type_operator operator, valuedup = strdup(value); mvaluedup = strdup(mvalue); for (i = 0; i < strlen(valuedup); i++) { - valuedup[i] = tolower(valuedup[i]); + valuedup[i] = tolower((unsigned char)valuedup[i]); } for (i = 0; i < strlen(mvaluedup); i++) { - mvaluedup[i] = tolower(mvaluedup[i]); + mvaluedup[i] = tolower((unsigned char)mvaluedup[i]); } result = strstr(valuedup, mvaluedup) != 0; free(valuedup); diff --git a/examples/ldns-signzone.c b/examples/ldns-signzone.c index c08c98d5..1a5678c5 100644 --- a/examples/ldns-signzone.c +++ b/examples/ldns-signzone.c @@ -336,7 +336,7 @@ parse_algspec ( const char * const p ) if ( p == NULL ) return 0; - if ( isdigit ( *p ) ) { + if ( isdigit ( (const unsigned char)*p ) ) { const char *nptr = NULL; const long id = strtol ( p, (char **) &nptr, 10 ); return id > 0 && nptr != NULL && *nptr == ',' ? id : 0; diff --git a/str2host.c b/str2host.c index 435ad1a4..0bf62d10 100644 --- a/str2host.c +++ b/str2host.c @@ -1121,7 +1121,7 @@ ldns_str2rdf_wks(ldns_rdf **rd, const char *str) proto_str = strdup(token); lc_proto_str = strdup(token); for (c = lc_proto_str; *c; c++) { - *c = tolower(*c); + *c = tolower((unsigned char)*c); } if (!proto_str || !lc_proto_str) { free(proto_str); @@ -1138,7 +1138,7 @@ ldns_str2rdf_wks(ldns_rdf **rd, const char *str) } if (!serv && (lc_token = strdup(token))) { for (c = lc_token; *c; c++) { - *c = tolower(*c); + *c = tolower((unsigned char)*c); } serv = getservbyname(lc_token, proto_str); if (!serv) {