Permalink
Browse files

do a better job at escaping TXT, fixes #795

  • Loading branch information...
1 parent 78cb2bd commit 837f4b49747bb14da1baa575956f5105b3759d4b @Habbie Habbie committed May 13, 2013
Showing with 1 addition and 4 deletions.
  1. +1 −4 pdns/dnsparser.cc
View
@@ -392,10 +392,7 @@ static string txtEscape(const string &name)
char ebuf[5];
for(string::const_iterator i=name.begin();i!=name.end();++i) {
- if(*i=='\n') { // XXX FIXME this should do a way better job!
- ret += "\\010";
- }
- else if((unsigned char) *i > 127) {
+ if((unsigned char) *i > 127 || (unsigned char) *i < 32) {
snprintf(ebuf, sizeof(ebuf), "\\%03u", (unsigned char)*i);
ret += ebuf;
}

0 comments on commit 837f4b4

Please sign in to comment.