From: Aki Tuomi Date: Mon, 8 Jan 2018 10:34:00 +0000 (+0200) Subject: pdns: RecordTextReader - trim whitespace X-Git-Tag: dnsdist-1.3.0~159^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6158%2Fhead;p=thirdparty%2Fpdns.git pdns: RecordTextReader - trim whitespace DNS records should not care if there is whitespace around them. --- diff --git a/pdns/rcpgenerator.cc b/pdns/rcpgenerator.cc index c31579f76f..359009b101 100644 --- a/pdns/rcpgenerator.cc +++ b/pdns/rcpgenerator.cc @@ -28,13 +28,18 @@ #include "misc.hh" #include "utility.hh" #include +#include + #include #include "base32.hh" #include "base64.hh" #include "namespaces.hh" -RecordTextReader::RecordTextReader(const string& str, const string& zone) : d_string(str), d_zone(zone), d_pos(0), d_end(str.size()) +RecordTextReader::RecordTextReader(const string& str, const string& zone) : d_string(str), d_zone(zone), d_pos(0) { + /* remove whitespace */ + boost::trim_if(d_string, boost::algorithm::is_space()); + d_end = d_string.size(); } void RecordTextReader::xfr48BitInt(uint64_t &val)