]> granicus.if.org Git - pdns/commitdiff
fix double dot on PTR & co
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 12 Sep 2017 09:05:45 +0000 (11:05 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 12 Sep 2017 09:05:45 +0000 (11:05 +0200)
pdns/dnsrecords.cc

index ac3bfd3d989f036656c1dd24b11764ea300f7b95..1c3c1f79fdba9cc67258cc4b2c8f2c8d79bc4889 100644 (file)
@@ -64,10 +64,8 @@ string DNSResourceRecord::getZoneRepresentation(bool noDot) const {
     case QType::NS:
     case QType::PTR:
       ret<<content;
-      if (content != ".") {
-        if(!noDot)
-          ret<<".";
-      }
+      if (*(content.rbegin()) != '.' && !noDot)
+        ret<<".";
       break;
     default:
       ret<<content;