]> granicus.if.org Git - php/commitdiff
-NAN should not be possible
authorAntony Dovgal <tony2001@php.net>
Tue, 19 Dec 2006 13:26:39 +0000 (13:26 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 19 Dec 2006 13:26:39 +0000 (13:26 +0000)
main/snprintf.c

index bcd1b365afba548c28d8380d4f3f1c2f92e2a8b5..2fad6e82488dcaeccb21e9dc9c304761c993a1f1 100644 (file)
@@ -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);