From: Frank Stettner Date: Tue, 17 Dec 2019 18:55:28 +0000 (+0100) Subject: hp-3478a: Check for overflow. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=675cb86f15c65893791fe5e4ec4914eb4484e6d6;p=libsigrok.git hp-3478a: Check for overflow. --- diff --git a/src/hardware/hp-3478a/protocol.c b/src/hardware/hp-3478a/protocol.c index 74acd144..7842f2f4 100644 --- a/src/hardware/hp-3478a/protocol.c +++ b/src/hardware/hp-3478a/protocol.c @@ -497,6 +497,10 @@ SR_PRIV int hp_3478a_receive_data(int fd, int revents, void *cb_data) if (sr_scpi_get_double(scpi, NULL, &devc->measurement) != SR_OK) return FALSE; + /* Check for overflow. */ + if (devc->measurement >= 9.998e+9) + devc->measurement = INFINITY; + /* * This is necessary to get the actual range for the encoding digits. * Must be called after reading the value, because it resets the