summaryrefslogtreecommitdiff
path: root/ext/pdo_odbc/odbc_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_odbc/odbc_driver.c')
-rw-r--r--ext/pdo_odbc/odbc_driver.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
index d4bf234689..2828b96e81 100644
--- a/ext/pdo_odbc/odbc_driver.c
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -36,22 +36,20 @@ static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *inf
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
pdo_odbc_errinfo *einfo = &H->einfo;
pdo_odbc_stmt *S = NULL;
- char *message = NULL;
+ zend_string *message = NULL;
if (stmt) {
S = (pdo_odbc_stmt*)stmt->driver_data;
einfo = &S->einfo;
}
- spprintf(&message, 0, "%s (%s[%ld] at %s:%d)",
+ message = strpprintf(0, "%s (%s[%ld] at %s:%d)",
einfo->last_err_msg,
einfo->what, einfo->last_error,
einfo->file, einfo->line);
add_next_index_long(info, einfo->last_error);
- // TODO: avoid reallocation ???
- add_next_index_string(info, message);
- efree(message);
+ add_next_index_str(info, message);
add_next_index_string(info, einfo->last_state);
return 1;
@@ -358,7 +356,7 @@ static int odbc_handle_get_attr(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC)
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
switch (attr) {
case PDO_ATTR_CLIENT_VERSION:
- ZVAL_STRING(val, "ODBC-" PDO_ODBC_TYPE, 1);
+ ZVAL_STRING(val, "ODBC-" PDO_ODBC_TYPE);
return 1;
case PDO_ATTR_SERVER_VERSION: