From: Fabian Keil <fk@fabiankeil.de>
Date: Thu, 23 Jul 2020 12:00:53 +0000 (+0200)
Subject: Collapse two if blocks into one
X-Git-Tag: v_3_0_29~247
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/static/@default-cgi@show-status?a=commitdiff_plain;h=d119cac814d19b58c0a299ebaeed7f58edf887d5;p=privoxy.git

Collapse two if blocks into one

Sponsored by: Robert Klemme
---

diff --git a/ssl.c b/ssl.c
index e2389f08..85701ce0 100644
--- a/ssl.c
+++ b/ssl.c
@@ -1548,13 +1548,10 @@ static int host_is_ip_address(const char *host)
 
    for (p = host; *p; p++)
    {
-      if (*p != '.')
+      if ((*p != '.') && !privoxy_isdigit(*p))
       {
-         if (!privoxy_isdigit(*p))
-         {
-            /* Not a dot or digit so it can't be an IPv4 address. */
-            return 0;
-         }
+         /* Not a dot or digit so it can't be an IPv4 address. */
+         return 0;
       }
    }