summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-02-11 13:29:58 +0000
committerrandomdan <randomdan@localhost>2011-02-11 13:29:58 +0000
commit47a40e0ad543e7e6e360266fbf62885787062ec5 (patch)
tree9e500f97b790fbe4d09f27542469f138085c760c
parentFix buffer size to hold a complete date/time (diff)
downloadlibdbpp-postgresql-47a40e0ad543e7e6e360266fbf62885787062ec5.tar.bz2
libdbpp-postgresql-47a40e0ad543e7e6e360266fbf62885787062ec5.tar.xz
libdbpp-postgresql-47a40e0ad543e7e6e360266fbf62885787062ec5.zip
Fix binding length to handle multibyte content
-rw-r--r--libpqpp/command.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpqpp/command.cpp b/libpqpp/command.cpp
index be766c9..eb5a6bf 100644
--- a/libpqpp/command.cpp
+++ b/libpqpp/command.cpp
@@ -121,9 +121,9 @@ void
PQ::Command::bindParamS(unsigned int n, const Glib::ustring & s)
{
paramsAtLeast(n);
- values[n] = strndup(s.c_str(), s.length());
+ values[n] = strndup(s.c_str(), s.bytes());
formats[n] = 0;
- lengths[n] = s.length();
+ lengths[n] = s.bytes();
}
void
PQ::Command::bindParamT(unsigned int n, const tm * v)