summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx10
-rw-r--r--connectivity/source/drivers/firebird/Util.cxx16
2 files changed, 10 insertions, 16 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index a29c822c5b33..be8d8eb9b85f 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -704,13 +704,13 @@ void OPreparedStatement::setParameterNull(sal_Int32 nParameterIndex,
bool bSetNull)
{
XSQLVAR* pVar = m_pInSqlda->sqlvar + (nParameterIndex - 1);
- if (pVar->sqltype & 1)
+ if (bSetNull)
{
- if (bSetNull)
- *pVar->sqlind = -1;
- else
- *pVar->sqlind = 0;
+ pVar->sqltype |= 1;
+ *pVar->sqlind = -1;
}
+ else
+ *pVar->sqlind = 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx
index ddb9d022c3e9..00eb4aa3f62e 100644
--- a/connectivity/source/drivers/firebird/Util.cxx
+++ b/connectivity/source/drivers/firebird/Util.cxx
@@ -254,11 +254,8 @@ void firebird::mallocSQLVAR(XSQLDA* pSqlda)
assert(false);
break;
}
- if (pVar->sqltype & 1)
- {
- /* allocate variable to hold NULL status */
- pVar->sqlind = static_cast<short *>(malloc(sizeof(short)));
- }
+ /* allocate variable to hold NULL status */
+ pVar->sqlind = static_cast<short *>(malloc(sizeof(short)));
}
}
@@ -302,13 +299,10 @@ void firebird::freeSQLVAR(XSQLDA* pSqlda)
break;
}
- if (pVar->sqltype & 1)
+ if(pVar->sqlind)
{
- if(pVar->sqlind)
- {
- free(pVar->sqlind);
- pVar->sqlind = nullptr;
- }
+ free(pVar->sqlind);
+ pVar->sqlind = nullptr;
}
}
}