From 1f173010b87ce43da9c3635ffda96629a5beef40 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Dec 2008 22:48:35 +0000 Subject: Don't serialise Nan or infinite port values (fix ticket #312). git-svn-id: http://svn.drobilla.net/lad/trunk/raul@1895 a436a847-0d15-0410-975c-d299462d15a1 --- raul/AtomRDF.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/raul/AtomRDF.hpp b/raul/AtomRDF.hpp index 518991f..365aade 100644 --- a/raul/AtomRDF.hpp +++ b/raul/AtomRDF.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "raul/Atom.hpp" #include "redlandmm/Node.hpp" @@ -72,6 +73,8 @@ atom_to_node(Redland::World& world, const Atom& atom) type = librdf_new_uri(world.world(), CUC("http://www.w3.org/2001/XMLSchema#integer")); break; case Atom::FLOAT: + if (isnan(atom.get_float()) || isinf(atom.get_float())) + break; os.precision(8); os << atom.get_float(); str = os.str(); -- cgit v1.2.1