hp-3478a: Check for overflow.

This commit is contained in:
Frank Stettner 2019-12-17 19:55:28 +01:00 提交者 Uwe Hermann
父節點 7812a5c802
當前提交 675cb86f15
共有 1 個檔案被更改,包括 4 行新增0 行删除

查看文件

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