summaryrefslogtreecommitdiff
path: root/ssl
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2018-08-05 16:50:41 +0200
committerAndy Polyakov <appro@openssl.org>2018-08-07 08:56:54 +0200
commit5b37fef04a2b765835361f0652aaa0c41ed1b842 (patch)
tree47677e73f897a8b5921437c53c93070e61dec321 /ssl
parent28ad73181aeb3b0b027d53d3266159f4b2e15d5b (diff)
downloadopenssl-new-5b37fef04a2b765835361f0652aaa0c41ed1b842.tar.gz
Harmonize use of sk_TYPE_find's return value.
In some cases it's about redundant check for return value, in some cases it's about replacing check for -1 with comparison to 0. Otherwise compiler might generate redundant check for <-1. [Even formatting and readability fixes.] Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6860)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_ciph.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 9011e42fa8..b60cc79a2f 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -505,10 +505,7 @@ int ssl_cipher_get_evp(const SSL_SESSION *s, const EVP_CIPHER **enc,
ctmp.id = s->compress_meth;
if (ssl_comp_methods != NULL) {
i = sk_SSL_COMP_find(ssl_comp_methods, &ctmp);
- if (i >= 0)
- *comp = sk_SSL_COMP_value(ssl_comp_methods, i);
- else
- *comp = NULL;
+ *comp = sk_SSL_COMP_value(ssl_comp_methods, i);
}
/* If were only interested in comp then return success */
if ((enc == NULL) && (md == NULL))