diff options
author | randomdan <randomdan@localhost> | 2011-02-11 13:29:58 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-02-11 13:29:58 +0000 |
commit | 47a40e0ad543e7e6e360266fbf62885787062ec5 (patch) | |
tree | 9e500f97b790fbe4d09f27542469f138085c760c | |
parent | Fix buffer size to hold a complete date/time (diff) | |
download | libdbpp-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.cpp | 4 |
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) |