]> granicus.if.org Git - php/commitdiff
fixed implode "again" -
authorThies C. Arntzen <thies@php.net>
Mon, 21 Jun 1999 15:57:20 +0000 (15:57 +0000)
committerThies C. Arntzen <thies@php.net>
Mon, 21 Jun 1999 15:57:20 +0000 (15:57 +0000)
ext/standard/string.c

index 1a5aecd3de37fa57ab80a0c90c027e5fb4d2df43..e4385724ff7cd1049552b7d70e7a09475c17f194 100644 (file)
@@ -309,15 +309,15 @@ PHP_FUNCTION(explode)
 
 void _php3_implode(pval *delim, pval *arr, pval *return_value) 
 {
-       pval *tmp;
+       pval **tmp;
        int len = 0, count = 0;
 
        /* convert everything to strings, and calculate length */
        _php3_hash_internal_pointer_reset(arr->value.ht);
        while (_php3_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) {
-               convert_to_string(tmp);
-               if (tmp->type == IS_STRING && tmp->value.str.val != undefined_variable_string) {
-                       len += tmp->value.str.len;
+               convert_to_string(*tmp);
+               if ((*tmp)->type == IS_STRING && (*tmp)->value.str.val != undefined_variable_string) {
+                       len += (*tmp)->value.str.len;
                        if (count>0) {
                                len += delim->value.str.len;
                        }
@@ -332,9 +332,9 @@ void _php3_implode(pval *delim, pval *arr, pval *return_value)
        return_value->value.str.val[len] = '\0';
        _php3_hash_internal_pointer_reset(arr->value.ht);
        while (_php3_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) {
-               if (tmp->type == IS_STRING && tmp->value.str.val != undefined_variable_string) {
+               if ((*tmp)->type == IS_STRING && (*tmp)->value.str.val != undefined_variable_string) {
                        count--;
-                       strcat(return_value->value.str.val, tmp->value.str.val);
+                       strcat(return_value->value.str.val, (*tmp)->value.str.val);
                        if (count > 0) {
                                strcat(return_value->value.str.val, delim->value.str.val);
                        }