summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2014-06-27 17:29:42 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2014-09-05 09:52:22 +0200
commit22a13cab85398846ed521989531f9471b9a1835a (patch)
tree4cb4de6362466e3bd968dd45ddfafdf71ca031eb
parentc562a0b58d429d28829c65321cf04ab6cf474bc9 (diff)
be more paranoid
Change-Id: I8ab6c26a489f5cbb6b92c36313c6912939895e52
-rw-r--r--connectivity/source/drivers/odbc/OPreparedStatement.cxx2
-rw-r--r--connectivity/source/drivers/odbc/OTools.cxx1
2 files changed, 3 insertions, 0 deletions
diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
index cf737a0d6637..54f6a2638f26 100644
--- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
@@ -359,6 +359,8 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_
}
else
{
+ assert(getOwnConnection()->getTextEncoding() != RTL_TEXTENCODING_UCS2 &&
+ getOwnConnection()->getTextEncoding() != RTL_TEXTENCODING_UCS4);
OString sOData(
OUStringToOString(_sData, getOwnConnection()->getTextEncoding()));
nCharLen = nByteLen = sOData.getLength();
diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx
index bbfc1ead1186..fe3b391761aa 100644
--- a/connectivity/source/drivers/odbc/OTools.cxx
+++ b/connectivity/source/drivers/odbc/OTools.cxx
@@ -415,6 +415,7 @@ OUString OTools::getStringValue(OConnection* _pConnection,
case SQL_WLONGVARCHAR:
{
SQLWCHAR waCharArray[2048];
+ BOOST_STATIC_ASSERT(sizeof(waCharArray) % sizeof(SQLWCHAR) == 0);
rtl_TextEncoding nSQLWCHAREncoding = RTL_TEXTENCODING_UCS2;
BOOST_STATIC_ASSERT(sizeof(SQLWCHAR) == 2 || sizeof(SQLWCHAR) == 4);
if(sizeof(SQLWCHAR) == 4)