if(r.qtype.getCode() != QType::MX && r.qtype.getCode() != QType::SRV) {
r.content.clear();
for(unsigned int n= 6 + extraFields; n < parts.size(); ++n) {
- if(n!=6)
+ if(n!=6+extraFields)
r.content.append(1,' ');
r.content.append(parts[n]);
}
static DNSRecordContent* make(const string& zone)
{
AAAARecordContent *ar=new AAAARecordContent();
- if(Utility::inet_pton( AF_INET6, zone.c_str(), static_cast< void * >( ar->d_ip6 )) < 0)
+ if(Utility::inet_pton( AF_INET6, zone.c_str(), static_cast< void * >( ar->d_ip6 )) <= 0)
throw MOADNSException("Asked to encode '"+zone+"' as an IPv6 address, but does not parse");
return ar;
}