cvs: php3 /functions gd.c mysql.c string.c
| From: | Rasmus Lerdorf | Date: | Tue, 04 Jul 2000 16:52:19 +0000 |
| Subject: | cvs: php3 /functions gd.c mysql.c string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-618@lists.php.net to get a copy of this message | ||
rasmus Tue Jul 4 09:52:19 2000 EDT
Modified files:
/php3/functions gd.c mysql.c string.c
Log:
Fix some warnings and a potential bug in mysql_change_user()
Index: php3/functions/gd.c
diff -u php3/functions/gd.c:1.153 php3/functions/gd.c:1.154
--- php3/functions/gd.c:1.153 Tue May 2 07:41:44 2000
+++ php3/functions/gd.c Tue Jul 4 09:52:19 2000
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.153 2000/05/02 14:41:44 hholzgra Exp $ */
+/* $Id: gd.c,v 1.154 2000/07/04 16:52:19 rasmus Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -1139,11 +1139,11 @@
/* Width and height of image */
c = 1; width = im->sx;
while(width & 0x7f << 7*c) c++;
- while(c > 1) fputc(0x80 | (width >> 7*--c) & 0xff, fp);
+ while(c > 1) fputc(0x80 | ((width >> 7*--c) & 0xff), fp);
fputc(width & 0x7f,fp);
c = 1; height = im->sy;
while(height & 0x7f << 7*c) c++;
- while(c > 1) fputc(0x80 | (height >> 7*--c) & 0xff, fp);
+ while(c > 1) fputc(0x80 | ((height >> 7*--c) & 0xff), fp);
fputc(height & 0x7f,fp);
/* Actual image data */
@@ -1180,12 +1180,12 @@
/* Width and height of image */
c = 1; width = im->sx;
while(width & 0x7f << 7*c) c++;
- while(c > 1) php3_putc(0x80 | (width >> 7*--c) & 0xff);
+ while(c > 1) php3_putc(0x80 | ((width >> 7*--c) & 0xff));
php3_putc(width & 0x7f);
c = 1; height = im->sy;
while(height & 0x7f << 7*c) c++;
- while(c > 1) php3_putc(0x80 | (height >> 7*--c) & 0xff);
+ while(c > 1) php3_putc(0x80 | ((height >> 7*--c) & 0xff));
php3_putc(height & 0x7f);
/* Actual image data */
Index: php3/functions/mysql.c
diff -u php3/functions/mysql.c:1.196 php3/functions/mysql.c:1.197
--- php3/functions/mysql.c:1.196 Sun Mar 19 23:34:57 2000
+++ php3/functions/mysql.c Tue Jul 4 09:52:19 2000
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysql.c,v 1.196 2000/03/20 07:34:57 rasmus Exp $ */
+/* $Id: mysql.c,v 1.197 2000/07/04 16:52:19 rasmus Exp $ */
/* TODO:
@@ -437,7 +437,7 @@
tmp++;
if (tmp[0] != '/') {
port = atoi(tmp);
- if(tmp=strchr(tmp,':')) {
+ if((tmp=strchr(tmp,':'))) {
*tmp=0;
tmp++;
socket=tmp;
@@ -724,7 +724,7 @@
void php3_mysql_change_user(INTERNAL_FUNCTION_PARAMETERS)
{
pval *user=NULL,*passwd=NULL,*db=NULL,*mysql_link=NULL;
- int id,type;
+ int id=0,type;
MYSQL *mysql;
MySQL_TLS_VARS;
@@ -736,6 +736,7 @@
}
convert_to_string(user);
convert_to_string(passwd);
+ id = php3_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
break;
case 3:
if (getParameters(ht, 3, &user, &passwd, &db)==FAILURE) {
@@ -744,6 +745,7 @@
convert_to_string(user);
convert_to_string(passwd);
convert_to_string(db);
+ id = php3_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU);
break;
case 4:
if (getParameters(ht, 4, &user, &passwd, &db, &mysql_link)==FAILURE) {
Index: php3/functions/string.c
diff -u php3/functions/string.c:1.210 php3/functions/string.c:1.211
--- php3/functions/string.c:1.210 Tue May 30 17:21:02 2000
+++ php3/functions/string.c Tue Jul 4 09:52:19 2000
@@ -29,7 +29,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.210 2000/05/31 00:21:02 sas Exp $ */
+/* $Id: string.c,v 1.211 2000/07/04 16:52:19 rasmus Exp $ */
#include <stdio.h>
#include "php.h"
#include "internal_functions.h"
@@ -301,7 +301,7 @@
do {
add_index_stringl(return_value, i++, p1, p2-p1, 1);
p1 = p2 + delim->value.str.len;
- } while (p2 = _php3_memnstr(p1, delim->value.str.val, delim->value.str.len, endp));
+ } while ((p2 = _php3_memnstr(p1, delim->value.str.val, delim->value.str.len, endp)));
if (p1 <= endp) {
add_index_stringl(return_value, i++, p1, endp-p1, 1);