On some architectures, strtod does not turn "NaN" into 'Not A Number (NAN)'
[rrdtool.git] / src / rrd_restore.c
index f803ab6..e9363c6 100644 (file)
@@ -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);