diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-01-11 00:38:16 +0100 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-01-11 00:38:16 +0100 |
commit | 43f5ad6e968ce25f3752d6ea6f602e2d8f624ac2 (patch) | |
tree | 4477f20526dfac4f27d1894a4c2575b032e09b9c /src/IO | |
parent | 2c470d55a7a2e3c8fffa836f15371421062e671f (diff) |
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.
Diffstat (limited to 'src/IO')
-rw-r--r-- | src/IO/tls_openssl.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |