From: Ilia Alshanetsky Date: Wed, 13 Jun 2007 17:57:10 +0000 (+0000) Subject: MFB: Handle very small longs via double X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~462 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71bc2b7f8faa3761e7a21d011cfc7dc36671923f;p=php MFB: Handle very small longs via double --- diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c index 64a90500da..1193554797 100644 --- a/ext/json/JSON_parser.c +++ b/ext/json/JSON_parser.c @@ -285,7 +285,7 @@ static void json_create_zval(zval **z, smart_str *buf, int type TSRMLS_DC) if (type == IS_LONG) { double d = zend_strtod(buf->c, NULL); - if (d > LONG_MAX) { + if (d > LONG_MAX || d < -LONG_MAX) { ZVAL_DOUBLE(*z, d); } else { ZVAL_LONG(*z, (long)d);