]> granicus.if.org Git - php/commitdiff
MFB: Adjust previous fix to avoid compiler warnings
authorIlia Alshanetsky <iliaa@php.net>
Sat, 7 Mar 2009 22:36:42 +0000 (22:36 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 7 Mar 2009 22:36:42 +0000 (22:36 +0000)
sapi/apache_hooks/php_apache.c

index 52bd180570a16510a64f046d570c494b2025e621..47a9553e769fbb676a204999b967032223453a24 100644 (file)
@@ -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);