From: Jelte Jansen Date: Tue, 16 Aug 2005 09:56:32 +0000 (+0000) Subject: nsap support for str2host X-Git-Tag: release-1.0.0~281 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=657845051bc054669e65a11bc538008d32073640;p=thirdparty%2Fldns.git nsap support for str2host made hex reading more lenient --- diff --git a/str2host.c b/str2host.c index 16bbebe6..f298a26f 100644 --- a/str2host.c +++ b/str2host.c @@ -415,7 +415,8 @@ ldns_str2rdf_hex(ldns_rdf **rd, const char *str) if (isxdigit(*str)) { *t += ldns_hexdigit_to_int(*str) * i; } else { - return LDNS_STATUS_ERR; + /* error or be lenient and skip? */ + /*return LDNS_STATUS_ERR;*/ } ++str; } @@ -812,7 +813,10 @@ ldns_str2rdf_wks(ldns_rdf **rd, const char *str) ldns_status ldns_str2rdf_nsap(ldns_rdf **rd, const char *str) { - rd = rd; - str = str; - return LDNS_STATUS_NOT_IMPL; + /* just a hex string with optional dots? */ + if (str[0] != '0' || str[1] != 'x') { + return LDNS_STATUS_INVALID_STR; + } else { + return ldns_str2rdf_hex(rd, str+2); + } }