Skip to content

Commit

Permalink
Merge pull request lloyd#42 from 7AC/master
Browse files Browse the repository at this point in the history
errno not being reset
  • Loading branch information
lloyd committed Dec 19, 2011
2 parents 342b605 + c651473 commit 0b89371
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/yajl_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0b89371

Please sign in to comment.