mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Umm forgot to clean up the error messages, and add a stop for looping.
This commit is contained in:
parent
ee240f5e4b
commit
8d2d105cff
1 changed files with 8 additions and 3 deletions
|
@ -1128,14 +1128,14 @@ PHP_FUNCTION(odbc_data_source)
|
|||
int num_args = ZEND_NUM_ARGS();
|
||||
UCHAR server_name[100],
|
||||
desc[200];
|
||||
SQLSMALLINT len1, len2, fetch_type;
|
||||
SQLSMALLINT len1=0, len2=0, fetch_type;
|
||||
|
||||
if (num_args != 2) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (zend_get_parameters_ex(2, &zv_conn, &zv_fetch_type) == FAILURE) {
|
||||
php_error(E_WARNING, "Unable to get parameters");
|
||||
php_error(E_WARNING, "%s(): Unable to get parameters", get_active_function_name(TSRMLS_C));
|
||||
}
|
||||
|
||||
convert_to_long_ex(zv_fetch_type);
|
||||
|
@ -1143,7 +1143,7 @@ PHP_FUNCTION(odbc_data_source)
|
|||
|
||||
if (!(fetch_type == SQL_FETCH_FIRST ||
|
||||
fetch_type == SQL_FETCH_NEXT)) {
|
||||
php_error(E_WARNING, "odbc_data_source: Invalid fetch type (%d)", fetch_type);
|
||||
php_error(E_WARNING, "%s(): Invalid fetch type (%d)", get_active_function_name(TSRMLS_C), fetch_type);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1165,6 +1165,11 @@ PHP_FUNCTION(odbc_data_source)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (len1 == 0 || len2 == 0) {
|
||||
/* we have a non-valid entry... so stop the looping */
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
add_assoc_stringl_ex(return_value, "server", sizeof("server"), server_name, len1, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue