ovsdb-data: Make string parsing of negative 0 match JSON parsing.
[sliver-openvswitch.git] / lib / ovsdb-data.c
index b89aa57..70e290b 100644 (file)
@@ -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: