From 0f7034b57caa387a538ff589aaadd7e9469789e3 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Fri, 11 Dec 2015 16:52:30 +0200 Subject: [PATCH] Use proper conversion on pipe backend --- modules/pipebackend/pipebackend.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/pipebackend/pipebackend.cc b/modules/pipebackend/pipebackend.cc index 6405e9cb7..0fc29ae4e 100644 --- a/modules/pipebackend/pipebackend.cc +++ b/modules/pipebackend/pipebackend.cc @@ -25,7 +25,6 @@ #include #include #include -#include #include "pipebackend.hh" static const char *kBackendId = "[PIPEBackend]"; @@ -56,7 +55,7 @@ void CoWrapper::launch() d_cp = new UnixRemote(d_command, d_timeout); else d_cp = new CoProcess(d_command, d_timeout); - d_cp->send("HELO\t"+lexical_cast(d_abiVersion)); + d_cp->send("HELO\t"+std::to_string(d_abiVersion)); string banner; d_cp->receive(banner); L<(d_abiVersion) + "(use ABI version 5 or later)\n"; + return "not supported on ABI version " + std::to_string(d_abiVersion) + "(use ABI version 5 or later)\n"; ostringstream oss; @@ -257,16 +256,16 @@ bool PipeBackend::get(DNSResourceRecord &r) } if(d_abiVersion >= 3) { - r.scopeMask = atoi(parts[1].c_str()); - r.auth = atoi(parts[2].c_str()); + r.scopeMask = std::stoi(parts[1]); + r.auth = (parts[2] == "1"); } else { r.scopeMask = 0; r.auth = 1; } r.qname=DNSName(parts[1+extraFields]); r.qtype=parts[3+extraFields]; - r.ttl=atoi(parts[4+extraFields].c_str()); - r.domain_id=atoi(parts[5+extraFields].c_str()); + r.ttl=pdns_stou(parts[4+extraFields]); + r.domain_id=std::stoi(parts[5+extraFields]); if(r.qtype.getCode() != QType::MX && r.qtype.getCode() != QType::SRV) { r.content.clear(); -- 2.40.0