diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/ChangeLog | 7 | ||||
-rw-r--r-- | common/estream.c | 6 | ||||
-rw-r--r-- | common/pka.c | 18 |
3 files changed, 17 insertions, 14 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index 0c381de20..31a5a5f60 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,10 @@ +2011-08-04 Werner Koch <[email protected]> + + * pka.c (get_pka_info): Remove set but unused variables ARCOUNT + and NSCOUNT. + * estream.c (es_fwrite, es_fread): Remove set but unused variable + ERR. + 2011-04-29 Werner Koch <[email protected]> * estream.c (es_pth_kill): New. diff --git a/common/estream.c b/common/estream.c index 5d74fea01..2d6841572 100644 --- a/common/estream.c +++ b/common/estream.c @@ -2905,12 +2905,11 @@ es_fread (void *ES__RESTRICT ptr, size_t size, size_t nitems, estream_t ES__RESTRICT stream) { size_t ret, bytes; - int err; if (size * nitems) { ESTREAM_LOCK (stream); - err = es_readn (stream, ptr, size * nitems, &bytes); + es_readn (stream, ptr, size * nitems, &bytes); ESTREAM_UNLOCK (stream); ret = bytes / size; @@ -2927,12 +2926,11 @@ es_fwrite (const void *ES__RESTRICT ptr, size_t size, size_t nitems, estream_t ES__RESTRICT stream) { size_t ret, bytes; - int err; if (size * nitems) { ESTREAM_LOCK (stream); - err = es_writen (stream, ptr, size * nitems, &bytes); + es_writen (stream, ptr, size * nitems, &bytes); ESTREAM_UNLOCK (stream); ret = bytes / size; diff --git a/common/pka.c b/common/pka.c index b1247f602..918f19e75 100644 --- a/common/pka.c +++ b/common/pka.c @@ -47,7 +47,7 @@ /* Parse the TXT resource record. Format is: v=pka1;fpr=a4d94e92b0986ab5ee9dcd755de249965b0358a2;uri=string - + For simplicity white spaces are not allowed. Because we expect to use a new RRTYPE for this in the future we define the TXT really strict for simplicity: No white spaces, case sensitivity of the @@ -70,7 +70,7 @@ parse_txt_record (char *buffer, unsigned char *fpr) *pend++ = 0; if (strcmp (p, "v=pka1")) return -1; /* Wrong or missing version. */ - + p = pend; pend = strchr (p, ';'); if (pend) @@ -82,11 +82,11 @@ parse_txt_record (char *buffer, unsigned char *fpr) fpr[i] = xtoi_2 (p); if (i != 20) return -1; /* Fingerprint consists not of exactly 40 hexbytes. */ - + p = pend; if (!p || !*p) { - *buffer = 0; + *buffer = 0; return 0; /* Success (no URI given). */ } if (strncmp (p, "uri=", 4)) @@ -119,7 +119,7 @@ get_pka_info (const char *address, unsigned char *fpr) char *name; adns_answer *answer = NULL; char *buffer = NULL; - + domain = strrchr (address, '@'); if (!domain || domain == address || !domain[1]) return NULL; /* Invalid mail address given. */ @@ -146,7 +146,7 @@ get_pka_info (const char *address, unsigned char *fpr) adns_finish (state); return NULL; } - if (answer->status != adns_s_ok + if (answer->status != adns_s_ok || answer->type != adns_r_txt || !answer->nrrs) { /* log_error ("DNS query returned an error: %s (%s)\n", */ @@ -179,7 +179,7 @@ get_pka_info (const char *address, unsigned char *fpr) HEADER h; } answer; int anslen; - int qdcount, ancount, nscount, arcount; + int qdcount, ancount; int rc; unsigned char *p, *pend; const char *domain; @@ -210,8 +210,6 @@ get_pka_info (const char *address, unsigned char *fpr) qdcount = ntohs (answer.h.qdcount); ancount = ntohs (answer.h.ancount); - nscount = ntohs (answer.h.nscount); - arcount = ntohs (answer.h.arcount); if (!ancount) return NULL; /* Got no answer. */ @@ -224,7 +222,7 @@ get_pka_info (const char *address, unsigned char *fpr) rc = dn_skipname (p, pend); if (rc == -1) return NULL; - p += rc + QFIXEDSZ; + p += rc + QFIXEDSZ; } if (ancount > 1) |