From ab66360574cb73e4e4f802427e83bf6b83ca7c6f Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Mon, 7 May 2012 13:44:11 +0000 Subject: NO-JIRA Fix calculation of buffer size. Buffers that have hex chars may have hundreds of them. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1335016 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/log/Statement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpp') diff --git a/cpp/src/qpid/log/Statement.cpp b/cpp/src/qpid/log/Statement.cpp index 79f7a28100..09d1c9449f 100644 --- a/cpp/src/qpid/log/Statement.cpp +++ b/cpp/src/qpid/log/Statement.cpp @@ -36,7 +36,7 @@ std::string quote(const std::string& str) { size_t n = std::count_if(str.begin(), str.end(), nonPrint); if (n==0) return str; std::string ret; - ret.reserve(str.size()+2*n); // Avoid extra allocations. + ret.reserve(str.size()+3*n); // Avoid extra allocations. for (std::string::const_iterator i = str.begin(); i != str.end(); ++i) { if (nonPrint(*i)) { ret.push_back('\\'); -- cgit v1.2.1