From: Aurelien Jacobs Date: Thu, 12 Feb 2015 10:30:52 +0000 (+0100) Subject: input/vcd: fix parse_header() return value check. X-Git-Tag: libsigrok-0.4.0~645 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=73931b7cc732f490ba6d2413707e50462666fa86;p=libsigrok.git input/vcd: fix parse_header() return value check. Mixing tests for both a boolean and an SR_ERR at the same time is not really a good idea. parse_header() actually returns a boolean so only check if it returns FALSE. This fixes the following gcc-5 warning: src/input/vcd.c: In function 'receive': src/input/vcd.c:506:34: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] if (!parse_header(in, in->buf) != SR_OK) ^ --- diff --git a/src/input/vcd.c b/src/input/vcd.c index e1421571..f1d0b06c 100644 --- a/src/input/vcd.c +++ b/src/input/vcd.c @@ -503,7 +503,7 @@ static int receive(struct sr_input *in, GString *buf) if (!inc->got_header) { if (!have_header(in->buf)) return SR_OK; - if (!parse_header(in, in->buf) != SR_OK) + if (!parse_header(in, in->buf)) /* There was a header in there, but it was malformed. */ return SR_ERR;