diff --git a/CHANGES b/CHANGES index ee2f3ba019..9ad8a7e62d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3143. [bug] Silence clang compiler warnings. [RT #25174] + 3142. [bug] NAPTR is class agnostic. [RT #25429] 3141. [bug] Silence spurious "zone serial (0) unchanged" messages diff --git a/bin/dnssec/dnssec-dsfromkey.c b/bin/dnssec/dnssec-dsfromkey.c index 9c9f623bcc..d79c21999e 100644 --- a/bin/dnssec/dnssec-dsfromkey.c +++ b/bin/dnssec/dnssec-dsfromkey.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssec-dsfromkey.c,v 1.21 2011/03/24 23:47:48 tbox Exp $ */ +/* $Id: dnssec-dsfromkey.c,v 1.22 2011/08/18 04:52:35 marka Exp $ */ /*! \file */ @@ -292,12 +292,10 @@ emit(unsigned int dtype, isc_boolean_t showall, char *lookaside, fatal("can't print class"); isc_buffer_usedregion(&nameb, &r); - isc_util_fwrite(r.base, 1, r.length, stdout); - - putchar(' '); + printf("%.*s ", (int)r.length, r.base); isc_buffer_usedregion(&classb, &r); - isc_util_fwrite(r.base, 1, r.length, stdout); + printf("%.*s", (int)r.length, r.base); if (lookaside == NULL) printf(" DS "); @@ -305,8 +303,7 @@ emit(unsigned int dtype, isc_boolean_t showall, char *lookaside, printf(" DLV "); isc_buffer_usedregion(&textb, &r); - isc_util_fwrite(r.base, 1, r.length, stdout); - putchar('\n'); + printf("%.*s\n", (int)r.length, r.base); } ISC_PLATFORM_NORETURN_PRE static void diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c index 1a26cf0bbe..1405d7d32c 100644 --- a/lib/dns/dst_api.c +++ b/lib/dns/dst_api.c @@ -31,7 +31,7 @@ /* * Principal Author: Brian Wellington - * $Id: dst_api.c,v 1.59 2011/03/21 19:54:03 each Exp $ + * $Id: dst_api.c,v 1.60 2011/08/18 04:52:35 marka Exp $ */ /*! \file */ @@ -1579,7 +1579,8 @@ write_public_key(const dst_key_t *key, int type, const char *directory) { fprintf(fp, "%d ", key->key_ttl); isc_buffer_usedregion(&classb, &r); - isc_util_fwrite(r.base, 1, r.length, fp); + if (isc_util_fwrite(r.base, 1, r.length, fp) != r.length) + ret = DST_R_WRITEERROR; if ((type & DST_TYPE_KEY) != 0) fprintf(fp, " KEY "); @@ -1587,7 +1588,8 @@ write_public_key(const dst_key_t *key, int type, const char *directory) { fprintf(fp, " DNSKEY "); isc_buffer_usedregion(&textb, &r); - isc_util_fwrite(r.base, 1, r.length, fp); + if (isc_util_fwrite(r.base, 1, r.length, fp) != r.length) + ret = DST_R_WRITEERROR; fputc('\n', fp); fflush(fp); diff --git a/lib/dns/dst_parse.c b/lib/dns/dst_parse.c index bba0101a32..b3f3c275eb 100644 --- a/lib/dns/dst_parse.c +++ b/lib/dns/dst_parse.c @@ -31,7 +31,7 @@ /*% * Principal Author: Brian Wellington - * $Id: dst_parse.c,v 1.27 2010/12/23 04:07:58 marka Exp $ + * $Id: dst_parse.c,v 1.28 2011/08/18 04:52:35 marka Exp $ */ #include @@ -641,9 +641,7 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv, } isc_buffer_usedregion(&b, &r); - fprintf(fp, "%s ", s); - isc_util_fwrite(r.base, 1, r.length, fp); - fprintf(fp, "\n"); + fprintf(fp, "%s %.*s\n", s, (int)r.length, r.base); } /* Add the metadata tags */ @@ -661,14 +659,15 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv, isc_buffer_init(&b, buffer, sizeof(buffer)); result = dns_time32_totext(when, &b); - if (result != ISC_R_SUCCESS) - continue; + if (result != ISC_R_SUCCESS) { + fclose(fp); + return (DST_R_INVALIDPRIVATEKEY); + } isc_buffer_usedregion(&b, &r); - fprintf(fp, "%s ", timetags[i]); - isc_util_fwrite(r.base, 1, r.length, fp); - fprintf(fp, "\n"); + fprintf(fp, "%s %.*s\n", timetags[i], (int)r.length, + r.base); } }