Changed logic for LONG_MIN

This commit is contained in:
Matt Wilmas 2008-12-02 14:50:01 +00:00
parent ba7bc0ace4
commit 509b50ed70

View File

@ -278,7 +278,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 || d < -LONG_MAX) {
if (d > LONG_MAX || d < LONG_MIN) {
ZVAL_DOUBLE(*z, d);
} else {
ZVAL_LONG(*z, (long)d);