]> granicus.if.org Git - php/commitdiff
- Fix warnings
authorZeev Suraski <zeev@php.net>
Tue, 19 Sep 2000 17:37:34 +0000 (17:37 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 19 Sep 2000 17:37:34 +0000 (17:37 +0000)
- Fix URL scanner startup crash

ext/standard/array.c
ext/standard/basic_functions.c
ext/standard/url_scanner.c
ext/wddx/wddx.c

index 8260a5ee20f1ed24fc3c13182ab4cb577b935d04..76d8e7cc9a1bcaed2aa2ac2064d99cbf25d5167d 100644 (file)
@@ -2017,7 +2017,7 @@ PHP_FUNCTION(array_reverse)
 
        if (ZEND_NUM_ARGS() > 1) {
                convert_to_boolean_ex(z_preserve_keys);
-               preserve_keys = Z_LVAL_PP(z_preserve_keys);
+               preserve_keys = (zend_bool) Z_LVAL_PP(z_preserve_keys);
        }
        
        /* Initialize return array */
index ea3727b08e5f919b35a28ef6b6f0a28ec2fc60f8..974e7ac9a364bdc69f60edd344c880fb37b62f68 100644 (file)
@@ -26,6 +26,7 @@
 #include "php_standard.h"
 #include "php_math.h"
 #include "ext/standard/info.h"
+#include "ext/standard/url_scanner.h"
 #include "zend_operators.h"
 #include <stdarg.h>
 #include <stdlib.h>
@@ -645,6 +646,11 @@ static void basic_globals_ctor(BLS_D)
        BG(user_tick_functions) = NULL;
        zend_hash_init(&BG(sm_protected_env_vars), 5, NULL, NULL, 1);
        BG(sm_allowed_env_vars) = NULL;
+
+#ifdef TRANS_SID
+       memset(&BG(url_adapt_state), 0, sizeof(BG(url_adapt_state)));
+#endif
+
 #ifdef PHP_WIN32
        CoInitialize(NULL);
 #endif
index 2a79ee97bd5d6215f7080f161dc022e6cb237cf7..3431dcaa648a98c97b3277fe58c59a3ced62a3c4 100644 (file)
 #define BUFSIZE 256
 #endif
 
-PHP_RINIT_FUNCTION(url_scanner) {
+PHP_RINIT_FUNCTION(url_scanner)
+{
        url_adapt(NULL,0,NULL,NULL);
        return SUCCESS;
 }
 
-PHP_RSHUTDOWN_FUNCTION(url_scanner) {
+
+PHP_RSHUTDOWN_FUNCTION(url_scanner)
+{
        url_adapt(NULL,0,NULL,NULL);
        return SUCCESS;
 }
 
 
-static char *url_attr_addon(const char *tag,const char *attr,const char *val,const char *buf) {
+static char *url_attr_addon(const char *tag,const char *attr,const char *val,const char *buf)
+{
        int flag = 0;
        PLS_FETCH();
 
-       if(!strcasecmp(tag,"a")&&!strcasecmp(attr,"href")) {
+       if(!strcasecmp(tag,"a") && !strcasecmp(attr,"href")) {
                flag = 1;
        } else if(!strcasecmp(tag,"area" ) && !strcasecmp(attr,"href"   )) {
                flag = 1;
@@ -100,9 +104,9 @@ char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen
 
        if(src==NULL) {
                US.state=STATE_NORMAL;
-               if(US.tag)  {efree(US.tag);  US.tag =NULL; }
-               if(US.attr) {efree(US.attr); US.attr=NULL; }
-               if(US.val)  {efree(US.val);  US.val =NULL; }
+               if(US.tag)  { efree(US.tag);  US.tag =NULL; }
+               if(US.attr) { efree(US.attr); US.attr=NULL; }
+               if(US.val)  { efree(US.val);  US.val =NULL; }
                return NULL;
        }
 
index c1d580312798e9ddbbaf6c1b5e00975cb4766340..0dc03d6bb362dd6b8a709b345921c00a9b79627b 100644 (file)
@@ -39,6 +39,7 @@
 #include "ext/xml/php_xml.h"
 #include "ext/standard/php_incomplete_class.h"
 #include "ext/standard/base64.h"
+#include "ext/standard/info.h"
 
 #define WDDX_BUF_LEN                   256
 #define PHP_CLASS_NAME_VAR             "php_class_name"
@@ -242,6 +243,7 @@ PHP_MINIT_FUNCTION(wddx)
 }
 /* }}} */
 
+
 PHP_MINFO_FUNCTION(wddx)
 {
        php_info_print_table_start();