projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gre: Simplify net namespace operations.
[openvswitch]
/
lib
/
ovsdb-data.c
diff --git
a/lib/ovsdb-data.c
b/lib/ovsdb-data.c
index b89aa57a6fd742055568ff2ed270f9aa87dfc298..8631016ff8c2fe93590b57f7ac81d00f0c062c31 100644
(file)
--- 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);
}
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:
break;
case OVSDB_TYPE_BOOLEAN:
@@
-808,7
+813,10
@@
ovsdb_datum_to_json(const struct ovsdb_datum *datum,
static const char *
skip_spaces(const char *p)
{
static const char *
skip_spaces(const char *p)
{
- return p + strspn(p, " ");
+ while (isspace((unsigned char) *p)) {
+ p++;
+ }
+ return p;
}
static char *
}
static char *
@@
-835,8
+843,10
@@
parse_key_value(const char **s, const struct ovsdb_type *type,
error = parse_atom_token(s, type->key_type, key);
if (!error && type->value_type != OVSDB_TYPE_VOID) {
error = parse_atom_token(s, type->key_type, key);
if (!error && type->value_type != OVSDB_TYPE_VOID) {
+ *s = skip_spaces(*s);
if (**s == '=') {
(*s)++;
if (**s == '=') {
(*s)++;
+ *s = skip_spaces(*s);
error = parse_atom_token(s, type->value_type, value);
} else {
error = xasprintf("%s: syntax error at \"%c\" expecting \"=\"",
error = parse_atom_token(s, type->value_type, value);
} else {
error = xasprintf("%s: syntax error at \"%c\" expecting \"=\"",