Patchwork [ipset] Fix wrong bracket placing

login
register
mail settings
Submitter Thomas Jarosch
Date Dec. 27, 2012, 3:46 p.m.
Message ID <1952176.MYFl3FrgUH@storm>
Download mbox | patch
Permalink /patch/208331/
State Accepted
Headers show

Comments

Thomas Jarosch - Dec. 27, 2012, 3:46 p.m.
cppcheck (vaguely) reported:
[lib/parse.c:448]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
 lib/parse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/lib/parse.c b/lib/parse.c
index 550048c..d06e9cd 100644
--- a/lib/parse.c
+++ b/lib/parse.c
@@ -445,8 +445,8 @@  ipset_parse_proto(struct ipset_session *session,
 		uint8_t protonum;
 		int err;
 
-		if (!((err = string_to_u8(session, str, &protonum) == 0) &&
-		      (protoent = getprotobynumber(protonum)) != NULL))
+		if (!((err = string_to_u8(session, str, &protonum)) == 0) &&
+		      (protoent = getprotobynumber(protonum)) != NULL)
 			return syntax_err("cannot parse '%s' "
 					  "as a protocol", str);
 	}