]> granicus.if.org Git - php/commitdiff
Thou shalt use the API, and thou shalt be safe
authorZeev Suraski <zeev@php.net>
Sun, 23 May 1999 20:32:19 +0000 (20:32 +0000)
committerZeev Suraski <zeev@php.net>
Sun, 23 May 1999 20:32:19 +0000 (20:32 +0000)
ext/standard/dns.c

index 95d03aa208db4648bf94ef40e00c91f4e341c637..079ac1220ad2fdcd9ecdb5a62704c390e94db9ce 100644 (file)
@@ -237,7 +237,6 @@ PHP_FUNCTION(checkdnsrr)
 PHP_FUNCTION(getmxrr)
 {
        pval *host, *mx_list, *weight_list;
-       pval tmp1,tmp2;
        int need_weight = 0;
        int count,qdc;
        u_short type,weight;
@@ -313,14 +312,9 @@ PHP_FUNCTION(getmxrr)
                        RETURN_FALSE;
                }
                cp += i;
-               tmp1.value.str.len = strlen(buf);
-               tmp1.value.str.val = estrndup(buf,tmp1.value.str.len);
-               tmp1.type = IS_STRING;
-               _php3_hash_next_index_insert(mx_list->value.ht, (void *)&tmp1, sizeof(pval), NULL);
+               add_next_index_string(mx_list, buf, 1);
                if ( need_weight ) {
-                       tmp2.value.lval = (long)weight;
-                       tmp2.type = IS_LONG;
-                       _php3_hash_next_index_insert(weight_list->value.ht, (void *)&tmp2, sizeof(pval), NULL);
+                       add_next_index_long(weight_list, weight);
                }
        }
        RETURN_TRUE;