summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib/dns/rdata
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2005-04-19 17:15:54 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2005-04-19 17:15:54 +0000
commitf58a9436f2c5c263a756964e7391dc167b8210c0 (patch)
tree3e9cbc6bed3078b06f71b059fbadf4d9df98287b /usr.sbin/bind/lib/dns/rdata
parentbba2b6205529743303c55f5e552e55f29c13b5f7 (diff)
fix more cases of snprintf() returning -1. ok cloder@ niallo@
Diffstat (limited to 'usr.sbin/bind/lib/dns/rdata')
-rw-r--r--usr.sbin/bind/lib/dns/rdata/generic/soa_6.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/bind/lib/dns/rdata/generic/soa_6.c b/usr.sbin/bind/lib/dns/rdata/generic/soa_6.c
index ecbd87e7923..1d62c9f5b6b 100644
--- a/usr.sbin/bind/lib/dns/rdata/generic/soa_6.c
+++ b/usr.sbin/bind/lib/dns/rdata/generic/soa_6.c
@@ -130,14 +130,15 @@ totext_soa(ARGS_TOTEXT) {
for (i = 0; i < 5; i++) {
char buf[sizeof("2147483647")];
unsigned long num;
- unsigned int numlen;
+ int numlen;
num = uint32_fromregion(&dregion);
isc_region_consume(&dregion, 4);
numlen = snprintf(buf, sizeof(buf), "%lu", num);
- INSIST(numlen > 0 && numlen < sizeof("2147483647"));
+ INSIST(numlen != -1 && (size_t)numlen < sizeof(buf));
RETERR(str_totext(buf, target));
if (multiline && comment) {
- RETERR(str_totext(" ; " + numlen, target));
+ RETERR(str_totext(" ; " +
+ (unsigned int)numlen, target));
RETERR(str_totext(soa_fieldnames[i], target));
/* Print times in week/day/hour/minute/second form */
if (i >= 1) {