From: Uwe Hermann Date: Sat, 1 Dec 2012 19:11:40 +0000 (+0100) Subject: metex14: Fix 'is_ol' handling. X-Git-Tag: dsupstream~509 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8f46911e4252bddb680fb9adc603ea2640f1724e;p=libsigrok.git metex14: Fix 'is_ol' handling. Thanks to Bert Vermeulen for the reminder. --- diff --git a/hardware/common/dmm/metex14.c b/hardware/common/dmm/metex14.c index b15ac4f0..c3d9a4f6 100644 --- a/hardware/common/dmm/metex14.c +++ b/hardware/common/dmm/metex14.c @@ -61,10 +61,10 @@ static int parse_value(const uint8_t *buf, float *result) /* Bytes 5-7: Over limit (various forms) */ is_ol = 0; - is_ol += !strncmp((char *)&buf[5], ".OL", 3); - is_ol += !strncmp((char *)&buf[5], "O.L", 3); - is_ol += !strncmp((char *)&buf[5], "OL.", 3); - is_ol += !strncmp((char *)&buf[5], " OL", 3); + is_ol += (!strncmp((char *)&buf[5], ".OL", 3)) ? 1 : 0; + is_ol += (!strncmp((char *)&buf[5], "O.L", 3)) ? 1 : 0; + is_ol += (!strncmp((char *)&buf[5], "OL.", 3)) ? 1 : 0; + is_ol += (!strncmp((char *)&buf[5], " OL", 3)) ? 1 : 0; if (is_ol != 0) { sr_spew("Over limit."); *result = INFINITY;