commit d65a31bbfe07ccf749a1923fa109206c59dd8d55
parent ea932240c3d948ef79d5e1a65e83d772c8c29805
Author: Amitai Schleier <schmonz-web-git@schmonz.com>
Date: Thu, 24 Dec 2020 15:55:20 +0100
Fix -Wdangling-else.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dns.c b/dns.c
@@ -49,16 +49,17 @@ int type;
errno = 0;
if (!stralloc_copy(&glue,domain)) return DNS_MEM;
if (!stralloc_0(&glue)) return DNS_MEM;
- if (!responsebuflen)
+ if (!responsebuflen) {
if ((response.buf = (unsigned char *)alloc(PACKETSZ+1)))
responsebuflen = PACKETSZ+1;
else return DNS_MEM;
+ }
responselen = lookup(glue.s,C_IN,type,response.buf,responsebuflen);
if ((responselen >= responsebuflen) ||
(responselen > 0 && (((HEADER *)response.buf)->tc)))
{
- if (responsebuflen < 65536)
+ if (responsebuflen < 65536) {
if (alloc_re(&response.buf, responsebuflen, 65536))
responsebuflen = 65536;
else return DNS_MEM;
@@ -66,6 +67,7 @@ int type;
_res.options |= RES_USEVC;
responselen = lookup(glue.s,C_IN,type,response.buf,responsebuflen);
_res.options = saveresoptions;
+ }
}
if (responselen <= 0)
{