X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fhp-3478a%2Fprotocol.c;h=7842f2f4e25992ca81a9d72e2f6d63a783274256;hb=66b349841a7db1ec143d9cec2316ece99a741d04;hp=74acd144b0f1c77e0bf2de0a06f80fc4993dbb0a;hpb=7812a5c802cc78c9ec5b6373e7e1884743d6857f;p=libsigrok.git 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