From dbe08731504e8de9d7099a1e95ee13ffb3bb5123 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 7 Mar 2009 22:36:42 +0000 Subject: [PATCH] MFB: Adjust previous fix to avoid compiler warnings --- sapi/apache_hooks/php_apache.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c index 52bd180570..47a9553e76 100644 --- a/sapi/apache_hooks/php_apache.c +++ b/sapi/apache_hooks/php_apache.c @@ -713,22 +713,21 @@ PHP_FUNCTION(apache_request_server_port) PHP_FUNCTION(apache_request_remote_host) { zval *id; - long ztype = NULL; + long type = 0; request_rec *r; char *res; - int type = REMOTE_NAME; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &ztype) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &type) == FAILURE) { return; } - if (ztype) { - type = ztype; + if (!type) { + type = REMOTE_NAME } APREQ_GET_REQUEST(id, r); - res = (char *)ap_get_remote_host(r->connection, r->per_dir_config, type); + res = (char *)ap_get_remote_host(r->connection, r->per_dir_config, (int)type); if (res) { RETURN_STRING(res, 1); -- 2.40.0