diff options
author | Joey Ekstrom <joey@ryati.com> | 2011-07-07 12:38:02 -0600 |
---|---|---|
committer | Lloyd Hilaiel <lloyd@hilaiel.com> | 2011-12-19 16:11:45 -0700 |
commit | b0ea41643e411730b8411e282b229d98d5eb38b6 (patch) | |
tree | 43e62f35a586f7bc166a400590a27fd4a46e0165 | |
parent | 150333b2791527fc8a18fe078c9c73945aed47b5 (diff) | |
download | yajl-b0ea41643e411730b8411e282b229d98d5eb38b6.tar.gz |
Fixed a bug where valid integers were not being flagged as such, making
calls like YAJL_IS_INTEGER fail, even though parsing succeeded.
Consisted of removing checks that would have been necessary, if the
custom integer parsing wasn't used.
Signed-off-by: Lloyd Hilaiel <lloyd@hilaiel.com>
-rw-r--r-- | src/yajl_tree.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/yajl_tree.c b/src/yajl_tree.c index de76e54..e63240c 100644 --- a/src/yajl_tree.c +++ b/src/yajl_tree.c @@ -309,11 +309,10 @@ static int handle_number (void *ctx, const char *string, size_t string_length) v->u.number.flags = 0; - endptr = NULL; errno = 0; v->u.number.i = yajl_parse_integer((const unsigned char *) v->u.number.r, strlen(v->u.number.r)); - if ((errno == 0) && (endptr != NULL) && (*endptr == 0)) + if (errno == 0) v->u.number.flags |= YAJL_NUMBER_INT_VALID; endptr = NULL; |