From 43f5ad6e968ce25f3752d6ea6f602e2d8f624ac2 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 11 Jan 2024 00:38:16 +0100 Subject: Replace dReturn_val_if_fail() by a simple if() The macro hides a return path and makes it more difficult to read the condition as it is negated. --- src/IO/tls_openssl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/IO/tls_openssl.c b/src/IO/tls_openssl.c index c3e2673a..39343d3f 100644 --- a/src/IO/tls_openssl.c +++ b/src/IO/tls_openssl.c @@ -375,7 +375,8 @@ int a_Tls_openssl_connect_ready(const DilloUrl *url) Server_t *s; int ret = TLS_CONNECT_READY; - dReturn_val_if_fail(ssl_context, TLS_CONNECT_NEVER); + if (ssl_context == NULL) + return TLS_CONNECT_NEVER; if ((s = dList_find_sorted(servers, url, Tls_servers_by_url_cmp))) { if (s->cert_status == CERT_STATUS_RECEIVING) @@ -580,7 +581,8 @@ static bool_t pattern_match (const char *pattern, const char *string) static bool_t Tls_check_cert_hostname(X509 *cert, const char *host, int *choice) { - dReturn_val_if_fail(cert && host, FALSE); + if (cert == NULL || host == NULL) + return FALSE; char *msg; GENERAL_NAMES *subjectAltNames; -- cgit v1.2.3