From 907e1c81d3ddc31068ba55bf93a886feb511feed Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 2 Sep 2014 15:06:58 +1000 Subject: [PATCH] Import jansson huge val fix --- src/jansson-2.6/src/strconv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jansson-2.6/src/strconv.c b/src/jansson-2.6/src/strconv.c index 3e2cb7c4..58cf4ad3 100644 --- a/src/jansson-2.6/src/strconv.c +++ b/src/jansson-2.6/src/strconv.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "jansson_private.h" #include "strbuffer.h" @@ -69,7 +70,7 @@ int jsonp_strtod(strbuffer_t *strbuffer, double *out) value = strtod(strbuffer->value, &end); assert(end == strbuffer->value + strbuffer->length); - if(errno == ERANGE && value != 0) { + if((value == HUGE_VAL || value == -HUGE_VAL) && errno == ERANGE) { /* Overflow */ return -1; }