From 5967f668a28fb6cfcd2cbe9552c83979b8209fff Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Fri, 11 Dec 2015 16:45:48 +0200 Subject: [PATCH] Use proper conversions on mydns backend --- modules/mydnsbackend/mydnsbackend.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/mydnsbackend/mydnsbackend.cc b/modules/mydnsbackend/mydnsbackend.cc index baa858683..b37249aa2 100644 --- a/modules/mydnsbackend/mydnsbackend.cc +++ b/modules/mydnsbackend/mydnsbackend.cc @@ -165,7 +165,7 @@ bool MyDNSBackend::list(const DNSName &target, int zoneId, bool include_disabled d_origin = d_result[0][0]; if (d_origin[d_origin.length()-1] == '.') d_origin.erase(d_origin.length()-1); - d_minimum = atol(d_result[0][1].c_str()); + d_minimum = pdns_stou(d_result[0][1]); if (d_result.size()>1) { L<(rrow[0]); + zoneId = pdns_stou(rrow[0]); d_origin = stripDot(rrow[1]); - d_minimum = atol(rrow[2].c_str()); + d_minimum = pdns_stou(rrow[2]); found = true; break; } @@ -292,7 +292,7 @@ void MyDNSBackend::lookup(const QType &qtype, const DNSName &qname, DNSPacket *p found = true; d_origin = stripDot(rrow[0]); - d_minimum = atol(rrow[1].c_str()); + d_minimum = pdns_stou(rrow[1]); } if (found) { @@ -397,10 +397,10 @@ bool MyDNSBackend::get(DNSResourceRecord &rr) { if (rr.qtype.getCode() == QType::MX || rr.qtype.getCode() == QType::SRV) rr.content=rrow[2]+" "+rr.content; - rr.ttl = atol(rrow[3].c_str()); + rr.ttl = pdns_stou(rrow[3]); if (d_useminimalttl) rr.ttl = std::min(rr.ttl, d_minimum); - rr.domain_id=atol(rrow[4].c_str()); + rr.domain_id=pdns_stou(rrow[4]); rr.last_modified=0; -- 2.40.0