diff options
| author | Dan Kalowsky <kalowsky@php.net> | 2002-08-12 16:17:18 +0000 |
|---|---|---|
| committer | Dan Kalowsky <kalowsky@php.net> | 2002-08-12 16:17:18 +0000 |
| commit | 8d2d105cff9c02276e718c52cbe80da8c70c7aa0 (patch) | |
| tree | a66f27f75f584738953c16100e33a7060af22e53 /ext/odbc/php_odbc.c | |
| parent | ee240f5e4b502ba87208c91847eb577d59f8dce9 (diff) | |
| download | php-git-8d2d105cff9c02276e718c52cbe80da8c70c7aa0.tar.gz | |
Umm forgot to clean up the error messages, and add a stop for looping.
Diffstat (limited to 'ext/odbc/php_odbc.c')
| -rw-r--r-- | ext/odbc/php_odbc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 886abd6d00..65e8c0613d 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -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); |
