Author: chug Date: Mon May 7 13:44:11 2012 New Revision: 1335016 URL: http://svn.apache.org/viewvc?rev=1335016&view=rev Log: NO-JIRA Fix calculation of buffer size. Buffers that have hex chars may have hundreds of them.
Modified: qpid/trunk/qpid/cpp/src/qpid/log/Statement.cpp Modified: qpid/trunk/qpid/cpp/src/qpid/log/Statement.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/log/Statement.cpp?rev=1335016&r1=1335015&r2=1335016&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/log/Statement.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/log/Statement.cpp Mon May 7 13:44:11 2012 @@ -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('\\'); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org