summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Magnusson <bjori@php.net>2006-10-05 16:02:29 +0000
committerHannes Magnusson <bjori@php.net>2006-10-05 16:02:29 +0000
commit93909bb30e9ffe70e03eac50e100ec4f2fb79ecd (patch)
tree09c28559d65a04574a1d8f33beeb75c2bc9079da
parenta5d86612e3c7885ff65f46a5f59d0f71e068b71f (diff)
downloadphp-git-93909bb30e9ffe70e03eac50e100ec4f2fb79ecd.tar.gz
- nuke unused variable
- "prefer" two arguments - only print "wrong parameter count" once
-rw-r--r--ext/pgsql/pgsql.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 85db15c16d..9f6f00c35c 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3553,18 +3553,18 @@ PHP_FUNCTION(pg_escape_string)
{
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);