summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/odbc/php_odbc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index ea0dfdb7d2..521a3b4e75 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -2418,7 +2418,7 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
odbc_connection *conn;
pval **pv_handle;
- char *ptr, *dest;
+ char *ptr;
int argc, len;
argc = ZEND_NUM_ARGS();
@@ -2441,6 +2441,8 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
strncpy(ptr, conn->lasterrormsg, len);
}
} else {
+ ODBCLS_FETCH();
+
if (mode == 0) {
strncpy(ptr, ODBCG(laststate), len);
} else {