From: Antony Dovgal Date: Tue, 19 Dec 2006 13:26:39 +0000 (+0000) Subject: -NAN should not be possible X-Git-Tag: RELEASE_1_0_0RC1~642 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=884fb55a297d1f5489f9f861f176fa439499891e;p=php -NAN should not be possible --- diff --git a/main/snprintf.c b/main/snprintf.c index bcd1b365af..2fad6e8248 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -139,7 +139,7 @@ PHPAPI char *php_gcvt(double value, int ndigit, char dec_point, char exponent, c * Infinity or NaN, convert to inf or nan with sign. * We assume the buffer is at least ndigit long. */ - snprintf(buf, ndigit + 1, "%s%s", sign ? "-" : "", + snprintf(buf, ndigit + 1, "%s%s", (sign && *digits == 'I') ? "-" : "", *digits == 'I' ? "INF" : "NAN"); zend_freedtoa(digits); return (buf);