cvs: php4 /ext/mysqli mysqli_api.c

From: Date: Fri, 11 Apr 2003 04:29:28 +0000
Subject: cvs: php4 /ext/mysqli mysqli_api.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20228@lists.php.net to get a copy of this message
hholzgra Fri Apr 11 00:29:28 2003 EDT Modified files: /php4/ext/mysqli mysqli_api.c Log: parameter count for bind stuff is different in OO interface Index: php4/ext/mysqli/mysqli_api.c diff -u php4/ext/mysqli/mysqli_api.c:1.22 php4/ext/mysqli/mysqli_api.c:1.23 --- php4/ext/mysqli/mysqli_api.c:1.22 Thu Apr 3 03:03:59 2003 +++ php4/ext/mysqli/mysqli_api.c Fri Apr 11 00:29:28 2003 @@ -15,7 +15,7 @@ | Author: Georg Richter <georg@php.net> | +----------------------------------------------------------------------+ - $Id: mysqli_api.c,v 1.22 2003/04/03 08:03:59 georg Exp $ + $Id: mysqli_api.c,v 1.23 2003/04/11 04:29:28 hholzgra Exp $ */ #ifdef HAVE_CONFIG_H @@ -96,12 +96,22 @@ PR_COMMAND *prcommand; unsigned long rc; - /* check if number of parameters > 2 and odd */ - if (argc < 3 || !(argc & 1)) { + /* calculate and check number of parameters */ + num_vars = argc; + if (!getThis()) { + /* ignore handle parameter in procedural interface*/ + --num_vars; + } + if (num_vars % 2) { + /* we need variable/type pairs */ + WRONG_PARAM_COUNT; + } + if (num_vars < 2) { + /* there has to be at least one pair */ WRONG_PARAM_COUNT; - } else { - num_vars = (argc - 1) / 2; } + num_vars /= 2; + args = (zval ***)emalloc(argc * sizeof(zval **)); @@ -229,7 +239,7 @@ PR_STMT *prstmt; PR_COMMAND *prcommand; - if (argc < 2) { + if (argc < (getThis() ? 1 : 2)) { WRONG_PARAM_COUNT; }

« previous php.cvs (#20228) next »