From e31e85696c90b5e9543d8e405b85034710bd406c Mon Sep 17 00:00:00 2001 From: randomdan Date: Mon, 28 Jan 2013 20:04:50 +0000 Subject: Fix the statement buffer length, again --- libpqpp/command.cpp | 5 ++--- 1 file 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 static std::string addrStr(void * p, unsigned int no) { - std::string r; - r.resize(50); - r.resize(snprintf(const_cast(r.c_str()), 30, "pStatement_%u_%p", no, p)); + std::string r(50, ' '); + r.resize(snprintf(const_cast(r.c_str()), r.length(), "pStatement_%u_%p", no, p)); return r; } -- cgit v1.2.3