From 437dd0369a759e32ef8788b1829bc3b355952518 Mon Sep 17 00:00:00 2001 From: "Andrzej J.R. Hunt" Date: Fri, 30 Aug 2013 11:14:59 +0100 Subject: Cast pointer before dereferencing. (firebird-sdbc) We have a char* pointing to arbitrary data hence we need to cast to the right type, othwerwise we retrieve the first byte only. Change-Id: I6d3d08d15105a506c140044008c5255a8a8e4c39 --- connectivity/source/drivers/firebird/ResultSet.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'connectivity/source/drivers/firebird/ResultSet.cxx') diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx index 21d4152e75fa..7b106c3f7d87 100644 --- a/connectivity/source/drivers/firebird/ResultSet.cxx +++ b/connectivity/source/drivers/firebird/ResultSet.cxx @@ -361,10 +361,11 @@ bool OResultSet::isNull(sal_Int32 columnIndex) template T OResultSet::retrieveValue(sal_Int32 columnIndex) { + // TODO: check we have the right type. if ((m_bWasNull = isNull(columnIndex))) return 0; - return *m_pSqlda->sqlvar[columnIndex-1].sqldata; + return *((T*) m_pSqlda->sqlvar[columnIndex-1].sqldata); } template <> -- cgit