diff options
Diffstat (limited to 'src/lib/dns/question.cc')
-rw-r--r-- | src/lib/dns/question.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/dns/question.cc b/src/lib/dns/question.cc index 6ccb164ed1..bf39174c32 100644 --- a/src/lib/dns/question.cc +++ b/src/lib/dns/question.cc @@ -40,10 +40,15 @@ Question::Question(InputBuffer& buffer) : rrclass_ = RRClass(buffer); } -string -Question::toText() const { - return (name_.toText() + " " + rrclass_.toText() + " " + - rrtype_.toText() + "\n"); +std::string +Question::toText(bool newline) const { + std::string r(name_.toText() + " " + rrclass_.toText() + " " + + rrtype_.toText()); + if (newline) { + r.append("\n"); + } + + return (r); } unsigned int |