]> sigrok.org Git - libsigrok.git/blobdiff - hardware/common/dmm/metex14.c
metex14: Fix 'is_ol' handling.
[libsigrok.git] / hardware / common / dmm / metex14.c
index b15ac4f0c9a294a5be9387f1b78a7cd7e361c53a..c3d9a4f613fc09e9a52ea47399d899ceb2246230 100644 (file)
@@ -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;