Source: Remove trailing whitespaces from src/*.{h,c}
[exim.git] / src / src / dns.c
index dbe331ea53e341a905bbd7ed610d0ff81fa348e6..27ab2d2a237984469a17f990392734c03d2a980c 100644 (file)
@@ -40,7 +40,6 @@ fakens_search(const uschar *domain, int type, uschar *answerptr, int size)
 {
 int len = Ustrlen(domain);
 int asize = size;                  /* Locally modified */
-uschar *endname;
 uschar name[256];
 uschar utilname[256];
 uschar *aptr = answerptr;          /* Locally modified */
@@ -51,7 +50,6 @@ struct stat statbuf;
 if (domain[len - 1] == '.') len--;
 Ustrncpy(name, domain, len);
 name[len] = 0;
-endname = name + len;
 
 /* Look for the fakens utility, and if it exists, call it. */
 
@@ -86,7 +84,7 @@ if (stat(CS utilname, &statbuf) >= 0)
     asize -= rc;      /* may need to be passed on to res_search(). */
     }
 
-  /* If we ran out of output buffer before exhasting the return,
+  /* If we ran out of output buffer before exhausting the return,
   carry on reading and counting it. */
 
   if (asize == 0)
@@ -390,7 +388,8 @@ from the following bytes. */
 
 dnss->aptr += namelen;
 GETSHORT(dnss->srr.type, dnss->aptr); /* Record type */
-dnss->aptr += 6;                      /* Don't want class or TTL */
+dnss->aptr += 2;                      /* Don't want class */
+GETLONG(dnss->srr.ttl, dnss->aptr);   /* TTL */
 GETSHORT(dnss->srr.size, dnss->aptr); /* Size of data portion */
 dnss->srr.data = dnss->aptr;          /* The record's data follows */
 dnss->aptr += dnss->srr.size;         /* Advance to next RR */
@@ -424,7 +423,7 @@ if (!h->nscount || !h->aa) return NULL;
 for (rr = dns_next_rr((dns_answer*) dnsa, &dnss, RESET_AUTHORITY);
      rr;
      rr = dns_next_rr((dns_answer*) dnsa, &dnss, RESET_NEXT))
-  if (rr->type == h->ancount ? T_NS : T_SOA) return rr->name;
+  if (rr->type == (h->ancount ? T_NS : T_SOA)) return rr->name;
 return NULL;
 }
 
@@ -469,7 +468,7 @@ if (  !h->aa
    || !*trusted
    || !(auth_name = dns_extract_auth_name(dnsa))
    || OK != match_isinlist(auth_name, &trusted, 0, NULL, NULL,
-                           MCL_DOMAIN, TRUE, NULL) 
+                           MCL_DOMAIN, TRUE, NULL)
    )
   return FALSE;