diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-11-15 11:57:06 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-11-16 11:15:53 +0200 |
commit | f10c9f20e8d32330c9f4ab46a638ab5556cb61b8 (patch) | |
tree | 3fbb2bf1c01918999bf3282456ddb06a726860c5 /odb/qt/basic/oracle/qstring-traits.hxx | |
parent | d59ac6134105611fb8d0d2349f0acf720c88e7d6 (diff) |
Truncate excess QString and QByteArray data mapped to CHAR and RAW types
Diffstat (limited to 'odb/qt/basic/oracle/qstring-traits.hxx')
-rw-r--r-- | odb/qt/basic/oracle/qstring-traits.hxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/odb/qt/basic/oracle/qstring-traits.hxx b/odb/qt/basic/oracle/qstring-traits.hxx index 729de62..c0b6775 100644 --- a/odb/qt/basic/oracle/qstring-traits.hxx +++ b/odb/qt/basic/oracle/qstring-traits.hxx @@ -53,13 +53,13 @@ namespace odb is_null = false; const QByteArray& a (v.toUtf8 ()); + n = static_cast<std::size_t> (a.size ()); - //@@ Assert or throw? - // - assert (n <= c); + if (n > c) + n = c; - std::memcpy (b, a.data (), n); + std::memcpy (b, a.constData (), n); } } }; |