Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added errno resetting before setting/checking it in yajl_do_parse()

  • Loading branch information...
commit c651473311637c703df8fae4b2ea063909fdc43f 1 parent dbcba50
@7AC 7AC authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  src/yajl_parser.c
View
2  src/yajl_parser.c
@@ -279,6 +279,7 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText,
hand->ctx,(const char *) buf, bufLen));
} else if (hand->callbacks->yajl_integer) {
long long int i = 0;
+ errno = 0;
i = yajl_parse_integer(buf, bufLen);
if ((i == LLONG_MIN || i == LLONG_MAX) &&
errno == ERANGE)
@@ -306,6 +307,7 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText,
yajl_buf_clear(hand->decodeBuf);
yajl_buf_append(hand->decodeBuf, buf, bufLen);
buf = yajl_buf_data(hand->decodeBuf);
+ errno = 0;
d = strtod((char *) buf, NULL);
if ((d == HUGE_VAL || d == -HUGE_VAL) &&
errno == ERANGE)
Please sign in to comment.
Something went wrong with that request. Please try again.