From: oetiker Date: Wed, 10 Dec 2008 13:18:10 +0000 (+0000) Subject: On some architectures, strtod does not turn "NaN" into 'Not A Number (NAN)' X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3c4f542467cc903d2615cd5adc3eeb196779651a;p=rrdtool-all.git 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/branches/1.3@1705 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index 2335f592..f0de21a7 100644 --- a/program/src/rrd_restore.c +++ b/program/src/rrd_restore.c @@ -136,14 +136,12 @@ static int get_double_from_node( return (-1); } -#ifdef WIN32 - if (strcmp(str_ptr, " NaN ") == 0) + if (strstr(str_ptr, "NaN") != NULL) { *value = DNAN; xmlFree(str_ptr); return 0; } -#endif end_ptr = NULL; temp = strtod(str_ptr, &end_ptr);