From: Patrick Pelletier Date: Thu, 28 Feb 2013 05:19:16 +0000 (-0800) Subject: avoid sign mismatch warning in openssl_hostname_validation.c X-Git-Tag: release-2.1.3-alpha~33^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6021cb5027e6e0d818671540fabec735008523d2;p=libevent avoid sign mismatch warning in openssl_hostname_validation.c sample/openssl_hostname_validation.c: In function 'matches_common_name': sample/openssl_hostname_validation.c:80: warning: comparison between signed and unsigned integer expressions sample/openssl_hostname_validation.c: In function 'matches_subject_alternative_name': sample/openssl_hostname_validation.c:124: warning: comparison between signed and unsigned integer expressions --- diff --git a/sample/openssl_hostname_validation.c b/sample/openssl_hostname_validation.c index 94f0c0eb..6f40cea8 100644 --- a/sample/openssl_hostname_validation.c +++ b/sample/openssl_hostname_validation.c @@ -77,7 +77,7 @@ static HostnameValidationResult matches_common_name(const char *hostname, const common_name_str = (char *) ASN1_STRING_data(common_name_asn1); // Make sure there isn't an embedded NUL character in the CN - if (ASN1_STRING_length(common_name_asn1) != strlen(common_name_str)) { + if ((size_t)ASN1_STRING_length(common_name_asn1) != strlen(common_name_str)) { return MalformedCertificate; } @@ -121,7 +121,7 @@ static HostnameValidationResult matches_subject_alternative_name(const char *hos char *dns_name = (char *) ASN1_STRING_data(current_name->d.dNSName); // Make sure there isn't an embedded NUL character in the DNS name - if (ASN1_STRING_length(current_name->d.dNSName) != strlen(dns_name)) { + if ((size_t)ASN1_STRING_length(current_name->d.dNSName) != strlen(dns_name)) { result = MalformedCertificate; break; }