diff options
Diffstat (limited to 'cpp/src/qpid/log/Statement.cpp')
-rw-r--r-- | cpp/src/qpid/log/Statement.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpp/src/qpid/log/Statement.cpp b/cpp/src/qpid/log/Statement.cpp index db5d92c50a..c2b286f1e7 100644 --- a/cpp/src/qpid/log/Statement.cpp +++ b/cpp/src/qpid/log/Statement.cpp @@ -30,7 +30,7 @@ namespace log { namespace { using namespace std; -struct NonPrint { bool operator()(unsigned char c) { return !isprint(c); } }; +struct NonPrint { bool operator()(unsigned char c) { return !isprint(c) && !isspace(c); } }; const char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; @@ -43,6 +43,7 @@ std::string quote(const std::string& str) { for (string::const_iterator i = str.begin(); i != str.end(); ++i) { if (nonPrint(*i)) { ret.push_back('\\'); + ret.push_back('x'); ret.push_back(hex[((*i) >> 4)&0xf]); ret.push_back(hex[(*i) & 0xf]); } |