From: Jelte Jansen Date: Mon, 14 Nov 2005 15:08:03 +0000 (+0000) Subject: octal values were read and printed as decimal values X-Git-Tag: release-1.1.0~622 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b3b5956eddf23bf207f3f67aa0fe15cdcb6e50d4;p=thirdparty%2Fldns.git octal values were read and printed as decimal values --- diff --git a/host2str.c b/host2str.c index f4b68af9..0e317612 100644 --- a/host2str.c +++ b/host2str.c @@ -113,7 +113,7 @@ ldns_rdf2buffer_str_dname(ldns_buffer *output, ldns_rdf *dname) ldns_buffer_printf(output, "\\%c", data[src_pos]); /* isprint!? */ } else if (!isprint((int) data[src_pos])) { - ldns_buffer_printf(output, "\\%03u", data[src_pos]); + ldns_buffer_printf(output, "\\%03o", data[src_pos]); } else { ldns_buffer_printf(output, "%c", data[src_pos]); } diff --git a/str2host.c b/str2host.c index 8ea7cc14..4da7669e 100644 --- a/str2host.c +++ b/str2host.c @@ -206,8 +206,8 @@ ldns_str2rdf_dname(ldns_rdf **d, const char *str) isdigit((int) s[2]) && isdigit((int) s[3])) { /* cast this so it fits */ - val = (uint8_t) ldns_hexdigit_to_int((char) s[1]) * 100 + - ldns_hexdigit_to_int((char) s[2]) * 10 + + val = (uint8_t) ldns_hexdigit_to_int((char) s[1]) * 64 + + ldns_hexdigit_to_int((char) s[2]) * 8 + ldns_hexdigit_to_int((char) s[3]); *q = val; s += 3;