summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/lib/dns/name.c
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2006-04-05 17:36:37 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2006-04-05 17:36:37 +0000
commit0505bad000912a66c4f92c91a72202b9250e4bd5 (patch)
tree00d8701ac1f3ee5feadd765c0274e9ff0a95aeac /usr.sbin/bind/lib/dns/name.c
parent1da54ca1fd7764e567cd4bc055abd54d602773e1 (diff)
resolve conflicts
Diffstat (limited to 'usr.sbin/bind/lib/dns/name.c')
-rw-r--r--usr.sbin/bind/lib/dns/name.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/usr.sbin/bind/lib/dns/name.c b/usr.sbin/bind/lib/dns/name.c
index f32f7636317..4a176c7e0ce 100644
--- a/usr.sbin/bind/lib/dns/name.c
+++ b/usr.sbin/bind/lib/dns/name.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $ISC: name.c,v 1.127.2.7.2.11 2004/09/01 05:19:59 marka Exp $ */
+/* $ISC: name.c,v 1.127.2.7.2.14 2005/10/14 01:38:48 marka Exp $ */
#include <config.h>
@@ -945,9 +945,9 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
unsigned char *ndata, *label;
char *tdata;
char c;
- ft_state state, kind;
- unsigned int value, count, tbcount, bitlength, maxlength;
- unsigned int n1, n2, vlen, tlen, nrem, nused, digits, labels, tused;
+ ft_state state;
+ unsigned int value, count;
+ unsigned int n1, n2, tlen, nrem, nused, digits, labels, tused;
isc_boolean_t done;
unsigned char *offsets;
dns_offsets_t odata;
@@ -985,15 +985,10 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
*/
n1 = 0;
n2 = 0;
- vlen = 0;
label = NULL;
digits = 0;
value = 0;
count = 0;
- tbcount = 0;
- bitlength = 0;
- maxlength = 0;
- kind = ft_init;
/*
* Make 'name' empty in case of failure.
@@ -1051,7 +1046,6 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
state = ft_initialescape;
break;
}
- kind = ft_ordinary;
state = ft_ordinary;
if (nrem == 0)
return (ISC_R_NOSPACE);
@@ -1094,7 +1088,6 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
*/
return (DNS_R_BADLABELTYPE);
}
- kind = ft_ordinary;
state = ft_escape;
/* FALLTHROUGH */
case ft_escape:
@@ -1305,13 +1298,14 @@ dns_name_totext(dns_name_t *name, isc_boolean_t omit_final_dot,
trem--;
nlen--;
} else {
- char buf[5];
if (trem < 4)
return (ISC_R_NOSPACE);
- snprintf(buf, sizeof(buf),
- "\\%03u", c);
- memcpy(tdata, buf, 4);
- tdata += 4;
+ *tdata++ = 0x5c;
+ *tdata++ = 0x30 +
+ ((c / 100) % 10);
+ *tdata++ = 0x30 +
+ ((c / 10) % 10);
+ *tdata++ = 0x30 + (c % 10);
trem -= 4;
ndata++;
nlen--;