From: Ben Pfaff Date: Wed, 27 Jan 2010 23:38:29 +0000 (-0800) Subject: ovsdb-data: Make string parsing of negative 0 match JSON parsing. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54a687fd7b3ae2004638e289ae20a912cf4c03dd;p=openvswitch ovsdb-data: Make string parsing of negative 0 match JSON parsing. --- 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: