From: Ben Pfaff Date: Tue, 17 Nov 2009 00:54:13 +0000 (-0800) Subject: ovsdb-parser: Fix logic in ovsdb_parser_member(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d0101a0323397fbb4aa9f5bea4946a55880e045;p=openvswitch ovsdb-parser: Fix logic in ovsdb_parser_member(). I don't know why this test was written as it was. The new test makes more sense, and may be more correct as well. --- diff --git a/lib/ovsdb-parser.c b/lib/ovsdb-parser.c index d923d21a..5419467c 100644 --- a/lib/ovsdb-parser.c +++ b/lib/ovsdb-parser.c @@ -80,11 +80,10 @@ ovsdb_parser_member(struct ovsdb_parser *parser, const char *name, return NULL; } - if (value->type >= 0 && value->type < JSON_N_TYPES - && (types & (1u << value->type) - || (types & OP_ID - && value->type == JSON_STRING - && is_id(value->u.string)))) + if ((value->type >= 0 && value->type < JSON_N_TYPES + && types & (1u << value->type)) + || (types & OP_ID && value->type == JSON_STRING + && is_id(value->u.string))) { svec_add(&parser->used, name); return value;