Permalink
Browse files

- MFH: Removed WRONG_PARAM_COUNT usage

  • Loading branch information...
1 parent 241c414 commit 93638ba661bd157bb5519169f6f3d022ad99a2d9 @felipensp felipensp committed Jan 8, 2009
Showing with 9 additions and 15 deletions.
  1. +9 −15 ext/mssql/php_mssql.c
View
@@ -851,24 +851,18 @@ PHP_FUNCTION(mssql_pconnect)
PHP_FUNCTION(mssql_close)
{
zval *mssql_link_index = NULL;
- int id;
+ int id = -1;
mssql_link *mssql_ptr;
- switch (ZEND_NUM_ARGS()) {
- case 0:
- id = php_mssql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
- CHECK_LINK(id);
- break;
- case 1:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_link_index) == FAILURE) {
- return;
- }
- id = -1;
- break;
- default:
- WRONG_PARAM_COUNT;
- break;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mssql_link_index) == FAILURE) {
+ return;
}
+
+ if (mssql_link_index == NULL) {
+ id = php_mssql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+ CHECK_LINK(id);
+ }
+
ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink);
if (mssql_link_index) {

0 comments on commit 93638ba

Please sign in to comment.