From 580acd6b37888e55f5c6ea789451bd9ce1bc67c0 Mon Sep 17 00:00:00 2001 From: jdolecek Date: Wed, 10 Jul 2002 19:30:14 +0000 Subject: [PATCH] Fix bug introduced in previous rev 1.5 - the for() body in decode_bitstring() needs to be wrapped with curly braces. Pointed out by Greg A. Woods in bin/17525. --- dist/bind/lib/nameser/ns_name.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dist/bind/lib/nameser/ns_name.c b/dist/bind/lib/nameser/ns_name.c index 37236bf499e9..dfc5cb7be106 100644 --- a/dist/bind/lib/nameser/ns_name.c +++ b/dist/bind/lib/nameser/ns_name.c @@ -1,4 +1,4 @@ -/* $NetBSD: ns_name.c,v 1.5 2002/07/04 23:30:40 itojun Exp $ */ +/* $NetBSD: ns_name.c,v 1.6 2002/07/10 19:30:14 jdolecek Exp $ */ /* * Copyright (c) 1996,1999 by Internet Software Consortium. @@ -804,11 +804,12 @@ decode_bitstring(const char **cpp, char *dn, const char *eom) if (i < 0) return (-1); dn += i; - for (b = blen; b > 7; b -= 8, cp++) + for (b = blen; b > 7; b -= 8, cp++) { i = SPRINTF((dn, "%02x", *cp & 0xff)); if (i < 0) return (-1); dn += i; + } if (b > 4) { tc = *cp++; i = SPRINTF((dn, "%02x", tc & (0xff << (8 - b))));