From: Wouter Wijngaards Date: Mon, 3 Feb 2014 15:07:42 +0000 (+0000) Subject: slightly nicer loc conversion. X-Git-Tag: release-1.4.22rc1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4511c62d1e4acf6ad7cd3cab9d3745e00529d31e;p=thirdparty%2Funbound.git slightly nicer loc conversion. git-svn-id: file:///svn/unbound/trunk@3067 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/ldns/str2wire.c b/ldns/str2wire.c index 5a09a1326..0620328a4 100644 --- a/ldns/str2wire.c +++ b/ldns/str2wire.c @@ -1380,6 +1380,7 @@ int sldns_str2wire_loc_buf(const char* str, uint8_t* rd, size_t* len) uint32_t equator = (uint32_t)1<<31; /* 2**31 */ + /* only support version 0 */ uint32_t h = 0; uint32_t m = 0; uint8_t size_b = 1, size_e = 2; @@ -1392,7 +1393,6 @@ int sldns_str2wire_loc_buf(const char* str, uint8_t* rd, size_t* len) char *my_str = (char *) str; - /* only support version 0 */ if (isdigit((int) *my_str)) { h = (uint32_t) strtol(my_str, &my_str, 10); } else { @@ -1528,7 +1528,6 @@ east: if(*len < 16) return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL; rd[0] = 0; - rd[1] = 0; rd[1] = ((size_b << 4) & 0xf0) | (size_e & 0x0f); rd[2] = ((horiz_pre_b << 4) & 0xf0) | (horiz_pre_e & 0x0f); rd[3] = ((vert_pre_b << 4) & 0xf0) | (vert_pre_e & 0x0f);