]> granicus.if.org Git - php/commitdiff
unify behavior
authorAnatol Belski <ab@php.net>
Thu, 13 Apr 2017 10:49:41 +0000 (12:49 +0200)
committerAnatol Belski <ab@php.net>
Thu, 13 Apr 2017 10:50:18 +0000 (12:50 +0200)
ext/standard/streamsfuncs.c

index a9bf574260552bf27509ad148d7202e5057f9d9f..e74d900b06ebf5d400db9cb9152b32f428851975 100644 (file)
@@ -1657,13 +1657,11 @@ PHP_FUNCTION(stream_isatty)
                RETURN_FALSE;
        }
 #else
-       zend_stat_t stat;
-       if (zend_fstat(fileno, &stat) == 0) {
-               if ((stat.st_mode & /*S_IFMT*/0170000) == /*S_IFCHR*/0020000) {
-                       RETURN_TRUE;
-               }
+       zend_stat_t stat = {0};
+       if (zend_fstat(fileno, &stat) == 0 && (stat.st_mode & /*S_IFMT*/0170000) == /*S_IFCHR*/0020000) {
+               RETURN_TRUE;
        }
-       RETURN_NULL();
+       RETURN_FALSE;
 #endif
 }