From 013b8b3f60a7b3f3777499c62e729afc4f428bc0 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Tue, 24 May 2011 09:59:39 +0300 Subject: [PATCH] Clear errno before calling strtod() Fixes GH-27. --- src/load.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/load.c b/src/load.c index ba00386..98837a4 100644 --- a/src/load.c +++ b/src/load.c @@ -525,6 +525,7 @@ static int lex_scan_number(lex_t *lex, int c, json_error_t *error) lex_unget_unsave(lex, c); saved_text = strbuffer_value(&lex->saved_text); + errno = 0; value = strtod(saved_text, &end); assert(end == saved_text + lex->saved_text.length);