cvs: php4 /ext/odbc php_odbc.c

From: Date: Mon, 12 Aug 2002 16:17:19 +0000
Subject: cvs: php4 /ext/odbc php_odbc.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13282@lists.php.net to get a copy of this message
kalowsky Mon Aug 12 12:17:19 2002 EDT Modified files: /php4/ext/odbc php_odbc.c Log: Umm forgot to clean up the error messages, and add a stop for looping. Index: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.131 php4/ext/odbc/php_odbc.c:1.132 --- php4/ext/odbc/php_odbc.c:1.131 Mon Aug 12 12:04:48 2002 +++ php4/ext/odbc/php_odbc.c Mon Aug 12 12:17:18 2002 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.131 2002/08/12 16:04:48 kalowsky Exp $ */ +/* $Id: php_odbc.c,v 1.132 2002/08/12 16:17:18 kalowsky Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1128,14 +1128,14 @@ 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 @@ 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; } @@ -1162,6 +1162,11 @@ if (rc != SQL_SUCCESS) { /* ummm.... he did it */ odbc_sql_error(conn, NULL, "SQLDataSources"); + RETURN_FALSE; + } + + if (len1 == 0 || len2 == 0) { + /* we have a non-valid entry... so stop the looping */ RETURN_FALSE; }

« previous php.cvs (#13282) next »