cvs: pecl /tcpwrap tcpwrap.c

From: Date: Thu, 12 Aug 2004 21:30:42 +0000
Subject: cvs: pecl /tcpwrap tcpwrap.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-1638@lists.php.net to get a copy of this message
mg Thu Aug 12 17:30:42 2004 EDT Modified files: /pecl/tcpwrap tcpwrap.c Log: Simplify parameters checking. Thanks to Jakub Vrana. http://cvs.php.net/diff.php/pecl/tcpwrap/tcpwrap.c?r1=1.3&r2=1.4&ty=u Index: pecl/tcpwrap/tcpwrap.c diff -u pecl/tcpwrap/tcpwrap.c:1.3 pecl/tcpwrap/tcpwrap.c:1.4 --- pecl/tcpwrap/tcpwrap.c:1.3 Wed Jan 7 17:01:33 2004 +++ pecl/tcpwrap/tcpwrap.c Thu Aug 12 17:30:42 2004 @@ -15,7 +15,7 @@ | Author: | +----------------------------------------------------------------------+ - $Id: tcpwrap.c,v 1.3 2004/01/07 22:01:33 mg Exp $ + $Id: tcpwrap.c,v 1.4 2004/08/12 21:30:42 mg Exp $ */ #ifdef HAVE_CONFIG_H @@ -90,24 +90,8 @@ struct hostent *host_entry; argc = ZEND_NUM_ARGS(); - switch (argc) { - case 2: - if (zend_parse_parameters(argc TSRMLS_CC, "ss", &daemon, &daemon_l, &address, &address_l) == FAILURE) { - return; - } - break; - case 3: - if (zend_parse_parameters(argc TSRMLS_CC, "sss", &daemon, &daemon_l, &address, &address_l, &user, &user_l) == FAILURE) { - return; - } - break; - case 4: - if (zend_parse_parameters(argc TSRMLS_CC, "sssb", &daemon, &daemon_l, &address, &address_l, &user, &user_l, &nodns) == FAILURE) { - return; - } - break; - default: - WRONG_PARAM_COUNT; + if (zend_parse_parameters(argc TSRMLS_CC, "ss|sb", &daemon, &daemon_l, &address, &address_l, &user, &user_l, &nodns) == FAILURE) { + return; } if (!user) {

« previous php.pecl.cvs (#1638) next »