From: Anatol Belski Date: Thu, 13 Apr 2017 10:49:41 +0000 (+0200) Subject: unify behavior X-Git-Tag: php-7.2.0alpha1~116 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=858ad8a59853bddb1612a9958bfe8b792c4a81ce;p=php unify behavior --- diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index a9bf574260..e74d900b06 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -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 }