]> granicus.if.org Git - php/commitdiff
compiler warning fixed.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 28 Feb 2003 00:08:00 +0000 (00:08 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 28 Feb 2003 00:08:00 +0000 (00:08 +0000)
main/network.c

index 1f9cdc30d551b0dcc5c62351cc91b4fdb9afc59a..cc499bb3c18a33b6fdb15c48dd08914d4bf314f8 100644 (file)
@@ -189,12 +189,10 @@ static int php_network_getaddresses(const char *host, struct sockaddr ***sal, ch
 # endif
        
        if ((n = getaddrinfo(host, NULL, &hints, &res)) || res == NULL) {
-               char *str = res == NULL ? "null result pointer" : PHP_GAI_STRERROR(n);
-
                if (error_string) {
-                       spprintf(error_string, 0, "getaddrinfo: %s", str);
+                       spprintf(error_string, 0, "getaddrinfo: %s", (res == NULL ? "null result pointer" : PHP_GAI_STRERROR(n)));
                } else {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", str);
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", (res == NULL ? "null result pointer" : PHP_GAI_STRERROR(n)));
                }
                return 0;
        }