2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

ovsdb-data: Make string parsing of negative 0 match JSON parsing.

This commit is contained in:
Ben Pfaff
2010-01-27 15:38:29 -08:00
parent 0e17074a1a
commit 54a687fd7b

View 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: