com php-src: cleanuo (use zend_string instead of char* ): ext/pdo_odbc/odbc_driver.c

From: Date: Wed, 13 Aug 2014 18:26:07 +0000
Subject: com php-src: cleanuo (use zend_string instead of char* ): ext/pdo_odbc/odbc_driver.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79845@lists.php.net to get a copy of this message
Commit: 8296129e508a583218f029ca2bc391949318ffea Author: Dmitry Stogov <dmitry@zend.com> Wed, 13 Aug 2014 22:26:07 +0400 Parents: bb7d9005b5e31bb4004b0047b98c79f135585a38 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8296129e508a583218f029ca2bc391949318ffea Log: cleanuo (use zend_string instead of char*) Changed paths: M ext/pdo_odbc/odbc_driver.c Diff: diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index e620227..2828b96 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;

« previous php.cvs (#79845) next »