Avoid warnings about empty conditional statement bodies

Add extra {} braces around if/else statements which only
call SPICE_DEBUG to avoid:

../common/ssl_verify.c: In function 'verify_pubkey':
../common/ssl_verify.c:87:50: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
../common/ssl_verify.c: In function 'verify_hostname':
../common/ssl_verify.c:254:53: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
../common/ssl_verify.c: In function 'verify_subject':
../common/ssl_verify.c:381:41: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
This commit is contained in:
Daniel P. Berrange 2012-02-10 13:56:04 +00:00 committed by Marc-André Lureau
parent 0a96fe9364
commit 3bc7d096b6

View File

@ -83,12 +83,13 @@ static int verify_pubkey(X509* cert, const char *key, size_t key_size)
ret = EVP_PKEY_cmp(orig_pubkey, cert_pubkey);
if (ret == 1)
if (ret == 1) {
SPICE_DEBUG("public keys match");
else if (ret == 0)
} else if (ret == 0) {
SPICE_DEBUG("public keys mismatch");
else
} else {
SPICE_DEBUG("public keys types mismatch");
}
finish:
if (bio)
@ -255,8 +256,9 @@ static int verify_hostname(X509* cert, const char *hostname)
}
}
if (!cn_match)
if (!cn_match) {
SPICE_DEBUG("warning: common name mismatch");
}
return cn_match;
}
@ -384,10 +386,11 @@ int verify_subject(X509* cert, SpiceOpenSSLVerify* verify)
ret = X509_NAME_cmp(cert_subject, verify->in_subject);
if (ret == 0)
if (ret == 0) {
SPICE_DEBUG("subjects match");
else
} else {
SPICE_DEBUG("subjects mismatch");
}
return !ret;
}