]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/agilent-dmm/protocol.c
agilent-dmm: Set correct length in strncmp().
[libsigrok.git] / src / hardware / agilent-dmm / protocol.c
index 7c31fe81fa324f3d63ae437d060dde06e2237cd6..9122355be8fdf263b13839f4d67d1bb316ef5d9b 100644 (file)
@@ -414,6 +414,7 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match)
        struct sr_analog_encoding encoding;
        struct sr_analog_meaning meaning;
        struct sr_analog_spec spec;
+       struct sr_channel *prev_chan;
        float fvalue;
        const char *s;
        char *mstr;
@@ -473,8 +474,8 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match)
 
        sr_sw_limits_update_samples_read(&devc->limits, 1);
 
-skip_value:;
-       struct sr_channel *prev_chan = devc->cur_channel;
+skip_value:
+       prev_chan = devc->cur_channel;
        devc->cur_channel = sr_next_enabled_channel(sdi, devc->cur_channel);
        if (devc->cur_channel->index > prev_chan->index)
                return JOB_AGAIN;
@@ -704,7 +705,7 @@ static int recv_conf_u124x_5x(const struct sr_dev_inst *sdi, GMatchInfo *match)
                devc->cur_digits[i] = 4;
                devc->cur_encoding[i] = 5;
        } else if (!strncmp(mstr, "T1", 2) || !strncmp(mstr, "T2", 2) ||
-                  !strncmp(mstr, "TEMP", 2)) {
+                  !strncmp(mstr, "TEMP", 4)) {
                devc->cur_mq[i] = SR_MQ_TEMPERATURE;
                m2 = g_match_info_fetch(match, 2);
                if (!m2)