diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2007-06-13 17:56:41 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2007-06-13 17:56:41 +0000 |
commit | c969e9005bffd9643b15bb1f9da634074efe7282 (patch) | |
tree | 3926d0c966feba5242b38f8c0e55d2d6a7e313f8 /ext/json/JSON_parser.c | |
parent | 9f28e21bb1d8251229fd4f951ddc280c7dbea597 (diff) | |
download | php-git-c969e9005bffd9643b15bb1f9da634074efe7282.tar.gz |
Handle very small longs via double
Diffstat (limited to 'ext/json/JSON_parser.c')
-rw-r--r-- | ext/json/JSON_parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c index 9f46553f67..c054d5038e 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) 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); |