From: Bert Vermeulen Date: Fri, 29 Aug 2014 17:35:01 +0000 (+0200) Subject: agilent-dmm: Correctly parse negative overload. X-Git-Tag: libsigrok-0.4.0~1079 X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;h=f216eb869967d354a0cc546ed72b93cbd5015c04;p=libsigrok.git agilent-dmm: Correctly parse negative overload. --- diff --git a/src/hardware/agilent-dmm/sched.c b/src/hardware/agilent-dmm/sched.c index 11367305..b910f7aa 100644 --- a/src/hardware/agilent-dmm/sched.c +++ b/src/hardware/agilent-dmm/sched.c @@ -234,6 +234,7 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match) struct sr_datafeed_packet packet; struct sr_datafeed_analog analog; float fvalue; + const char *s; char *mstr; sr_spew("FETC reply '%s'.", g_match_info_get_string(match)); @@ -245,7 +246,8 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match) * get metadata soon enough. */ return SR_OK; - if (!strcmp(g_match_info_get_string(match), "+9.90000000E+37")) { + s = g_match_info_get_string(match); + if (!strcmp(s, "-9.90000000E+37") || !strcmp(s, "+9.90000000E+37")) { /* An invalid measurement shows up on the display as "O.L", but * comes through like this. Since comparing 38-digit floats * is rather problematic, we'll cut through this here. */