From 64ca9e4523344d80cb58584e3521c3271257f435 Mon Sep 17 00:00:00 2001 From: oetiker Date: Wed, 10 Dec 2008 13:18:10 +0000 Subject: [PATCH] On some architectures, strtod does not turn "NaN" into 'Not A Number (NAN)' se we better provide our own code here. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1705 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_restore.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index f803ab68..e9363c6e 100644 --- a/program/src/rrd_restore.c +++ b/program/src/rrd_restore.c @@ -143,6 +143,13 @@ static int get_double_from_node( return (-1); } + if (strstr(str_ptr, "NaN") != NULL) + { + *value = DNAN; + xmlFree(str_ptr); + return 0; + } + end_ptr = NULL; temp = strtod(str_ptr, &end_ptr); xmlFree(str_ptr); -- 2.30.2