bjori           Thu Oct  5 16:08:12 2006 UTC

  Modified files:              
    /php-src/ext/pgsql  pgsql.c 
  Log:
  MFB:
  - nuke unused variable
  - "prefer" two arguments
  - only print "wrong parameter count" once
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pgsql/pgsql.c?r1=1.356&r2=1.357&diff_format=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.356 php-src/ext/pgsql/pgsql.c:1.357
--- php-src/ext/pgsql/pgsql.c:1.356     Wed Oct  4 23:27:17 2006
+++ php-src/ext/pgsql/pgsql.c   Thu Oct  5 16:08:12 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: pgsql.c,v 1.356 2006/10/04 23:27:17 iliaa Exp $ */
+/* $Id: pgsql.c,v 1.357 2006/10/05 16:08:12 bjori Exp $ */
 
 #include <stdlib.h>
 
@@ -3540,18 +3540,18 @@
 {
        char *from = NULL, *to = NULL;
        zval *pgsql_link;
+#ifdef HAVE_PQESCAPE_CONN
        PGconn *pgsql;
+#endif
        int to_len;
        int from_len;
-       int id;
+       int id = -1;
 
-       if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == SUCCESS) {
-               id = -1;
-       } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, 
&from_len) == SUCCESS) {
+       if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, "s", &from, &from_len) == SUCCESS) {
                pgsql_link = NULL;
                id = PGG(default_link);
-       } else {
-               WRONG_PARAM_COUNT;
+       } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", 
&pgsql_link, &from, &from_len) == FAILURE) {
+               return;
        }
 
        to = (char *) safe_emalloc(from_len, 2, 1);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to