From d8dda8213ba0be75719a7edccdd0fdfa70f95ccb Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 10 Feb 2012 13:56:04 +0000 Subject: [PATCH] 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] --- ssl_verify.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ssl_verify.c b/ssl_verify.c index 6e8f102..cb77b7e 100644 --- a/ssl_verify.c +++ b/ssl_verify.c @@ -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; }