cvs: php4 /ext/sybase php_sybase_db.c
| From: | Rasmus Lerdorf | Date: | Mon, 06 Nov 2000 01:07:53 +0000 |
| Subject: | cvs: php4 /ext/sybase php_sybase_db.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2494@lists.php.net to get a copy of this message | ||
rasmus Sun Nov 5 17:07:53 2000 EDT
Modified files:
/php4/ext/sybase php_sybase_db.c
Log:
Make sure these are initialized to NULL
Index: php4/ext/sybase/php_sybase_db.c
diff -u php4/ext/sybase/php_sybase_db.c:1.9 php4/ext/sybase/php_sybase_db.c:1.10
--- php4/ext/sybase/php_sybase_db.c:1.9 Sun Oct 29 01:14:54 2000
+++ php4/ext/sybase/php_sybase_db.c Sun Nov 5 17:07:52 2000
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_sybase_db.c,v 1.9 2000/10/29 09:14:54 thies Exp $ */
+/* $Id: php_sybase_db.c,v 1.10 2000/11/06 01:07:52 rasmus Exp $ */
#include "php.h"
@@ -257,14 +257,13 @@
static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
{
- char *user,*passwd,*host,*charset;
+ char *user=NULL,*passwd=NULL,*host=NULL,*charset=NULL;
char *hashed_details;
int hashed_details_length;
sybase_link sybase,*sybase_ptr;
switch(ZEND_NUM_ARGS()) {
case 0: /* defaults */
- host=user=passwd=NULL;
hashed_details_length=6+3;
hashed_details = (char *) emalloc(hashed_details_length+1);
strcpy(hashed_details,"sybase___");
@@ -277,7 +276,6 @@
}
convert_to_string(yyhost);
host = yyhost->value.str.val;
- user=passwd=charset=NULL;
hashed_details_length = yyhost->value.str.len+6+3;
hashed_details = (char *) emalloc(hashed_details_length+1);
sprintf(hashed_details,"sybase_%s__",yyhost->value.str.val);
@@ -293,7 +291,6 @@
convert_to_string(yyuser);
host = yyhost->value.str.val;
user = yyuser->value.str.val;
- passwd=charset=NULL;
hashed_details_length = yyhost->value.str.len+yyuser->value.str.len+6+3;
hashed_details = (char *) emalloc(hashed_details_length+1);
sprintf(hashed_details,"sybase_%s_%s_",yyhost->value.str.val,yyuser->value.str.val);
@@ -311,7 +308,6 @@
host = yyhost->value.str.val;
user = yyuser->value.str.val;
passwd = yypasswd->value.str.val;
- charset = NULL;
hashed_details_length =
yyhost->value.str.len+yyuser->value.str.len+yypasswd->value.str.len+6+3;
hashed_details = (char *) emalloc(hashed_details_length+1);
sprintf(hashed_details,"sybase_%s_%s_%s",yyhost->value.str.val,yyuser->value.str.val,yypasswd->value.str.val);
/* SAFE */