From 54a687fd7b3ae2004638e289ae20a912cf4c03dd Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 27 Jan 2010 15:38:29 -0800 Subject: [PATCH] ovsdb-data: Make string parsing of negative 0 match JSON parsing. --- lib/ovsdb-data.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c index b89aa57a..70e290b0 100644 --- a/lib/ovsdb-data.c +++ b/lib/ovsdb-data.c @@ -396,6 +396,11 @@ ovsdb_atom_from_string(union ovsdb_atom *atom, enum ovsdb_atomic_type type, if (!str_to_double(s, &atom->real)) { return xasprintf("\"%s\" is not a valid real number", s); } + /* Our JSON input routines map negative zero to zero, so do that here + * too for consistency. */ + if (atom->real == 0.0) { + atom->real = 0.0; + } break; case OVSDB_TYPE_BOOLEAN: -- 2.30.2