hp-3478a: Check for overflow.

This commit is contained in:
Frank Stettner 2019-12-17 19:55:28 +01:00 committed by Uwe Hermann
parent 7812a5c802
commit 675cb86f15
1 changed files with 4 additions and 0 deletions

View File

@ -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