diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2010-10-11 03:07:03 +0000 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2010-10-11 03:07:03 +0000 |
commit | 17dc181117fd302ef196a959add39f38152a770e (patch) | |
tree | 2659d2dcb448d7ef0702c0a0239a11ad11648f47 | |
parent | 91f64706c2579764e23664812897ca2a466d7218 (diff) | |
download | php-git-17dc181117fd302ef196a959add39f38152a770e.tar.gz |
- Removed redundant local variable in dns_get_record.
- (5.3) Fixed bug in the Windows implementation of
dns_get_record, where the two last parameters wouldn't be
filled unless the type were DNS_ANY (Gustavo).
-rw-r--r-- | ext/standard/dns.c | 6 | ||||
-rw-r--r-- | ext/standard/dns_win32.c | 4 |
2 files changed, 3 insertions, 7 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c index dfbe7defd0..287935759b 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -707,7 +707,6 @@ PHP_FUNCTION(dns_get_record) int hostname_len; long type_param = PHP_DNS_ANY; zval *authns = NULL, *addtl = NULL; - int addtl_recs = 0; int type_to_fetch; #if defined(HAVE_DNS_SEARCH) struct sockaddr_storage from; @@ -736,7 +735,6 @@ PHP_FUNCTION(dns_get_record) if (addtl) { zval_dtor(addtl); array_init(addtl); - addtl_recs = 1; } if (!raw) { @@ -773,7 +771,7 @@ PHP_FUNCTION(dns_get_record) } for ( ; - type < (addtl_recs ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query; + type < (addtl ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query; type++ ) { first_query = 0; @@ -894,7 +892,7 @@ PHP_FUNCTION(dns_get_record) } } - if (addtl_recs && addtl) { + if (addtl) { /* Additional records associated with authoritative name servers */ while (ar-- > 0 && cp && cp < end) { zval *retval = NULL; diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index ba1c5a1abf..7bded1cdaf 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -347,7 +347,6 @@ PHP_FUNCTION(dns_get_record) long type_param = PHP_DNS_ANY; zval *authns = NULL, *addtl = NULL; int type, type_to_fetch, first_query = 1, store_results = 1; - int addtl_recs = 0; zend_bool raw = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz!z!b", @@ -362,7 +361,6 @@ PHP_FUNCTION(dns_get_record) if (addtl) { zval_dtor(addtl); array_init(addtl); - addtl_recs = 1; } if (!raw) { @@ -390,7 +388,7 @@ PHP_FUNCTION(dns_get_record) } for ( ; - type < (addtl_recs ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query; + type < (addtl ? (PHP_DNS_NUM_TYPES + 2) : PHP_DNS_NUM_TYPES) || first_query; type++ ) { DNS_STATUS status; /* Return value of DnsQuery_A() function */ |