summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorCharles E. Rolke <chug@apache.org>2012-05-07 13:44:11 +0000
committerCharles E. Rolke <chug@apache.org>2012-05-07 13:44:11 +0000
commitab66360574cb73e4e4f802427e83bf6b83ca7c6f (patch)
treef4d85a1543530468b00bde9b4a7e5f9b173e95f1 /cpp
parent29868a21a13af5ded0bc9920832a05bd7896e68a (diff)
downloadqpid-python-ab66360574cb73e4e4f802427e83bf6b83ca7c6f.tar.gz
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
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/log/Statement.cpp2
1 files changed, 1 insertions, 1 deletions
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('\\');