summaryrefslogtreecommitdiff
path: root/libpqpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2013-01-28 20:04:50 +0000
committerrandomdan <randomdan@localhost>2013-01-28 20:04:50 +0000
commite31e85696c90b5e9543d8e405b85034710bd406c (patch)
tree266d86d09c8b935e5e10a759405dc6112643f97a /libpqpp
parentIncrease buffer size for statement names (diff)
downloadlibdbpp-postgresql-e31e85696c90b5e9543d8e405b85034710bd406c.tar.bz2
libdbpp-postgresql-e31e85696c90b5e9543d8e405b85034710bd406c.tar.xz
libdbpp-postgresql-e31e85696c90b5e9543d8e405b85034710bd406c.zip
Fix the statement buffer length, again
Diffstat (limited to 'libpqpp')
-rw-r--r--libpqpp/command.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/libpqpp/command.cpp b/libpqpp/command.cpp
index fa2dc1d..b901310 100644
--- a/libpqpp/command.cpp
+++ b/libpqpp/command.cpp
@@ -4,9 +4,8 @@
#include <string.h>
static std::string addrStr(void * p, unsigned int no) {
- std::string r;
- r.resize(50);
- r.resize(snprintf(const_cast<char *>(r.c_str()), 30, "pStatement_%u_%p", no, p));
+ std::string r(50, ' ');
+ r.resize(snprintf(const_cast<char *>(r.c_str()), r.length(), "pStatement_%u_%p", no, p));
return r;
}