From 0ffe338027ba1eb9817c3eabb62be6d9a4edff87 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 7 Oct 2018 18:07:03 +0200 Subject: sensible behavior when reading NaN values --- src/object/sp-object.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/object/sp-object.cpp') diff --git a/src/object/sp-object.cpp b/src/object/sp-object.cpp index 7c6b6c28d..4a9a347c1 100644 --- a/src/object/sp-object.cpp +++ b/src/object/sp-object.cpp @@ -996,6 +996,14 @@ void SPObject::readAttr(gchar const *key) if (keyid != SP_ATTR_INVALID) { /* Retrieve the 'key' attribute from the object's XML representation */ gchar const *value = getRepr()->attribute(key); + if (value && + (!strcmp(value, "nan") + || !strcmp(value, "-nan") + || !strcmp(value, "NaN") + || !strcmp(value, "-NaN") + )) { + value = nullptr; + } setKeyValue(keyid, value); } -- cgit v1.2.3