MFH: Changed logic for LONG_MIN

This commit is contained in:
Matt Wilmas 2008-12-02 14:50:22 +00:00
parent 2b1a411806
commit d5295fc9c8

View File

@ -285,7 +285,7 @@ static void json_create_zval(zval **z, smart_str *buf, int type)
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);