scpi: avoid uninitialized use of a variable
The 'opc' variable was only conditionally assigned to (depends on successful SCPI communication). Ensure there always is a known value. This was reported by clang's scan-build.
This commit is contained in:
parent
d3ec7035bc
commit
da6f107eff
|
@ -651,6 +651,7 @@ SR_PRIV int sr_scpi_get_opc(struct sr_scpi_dev_inst *scpi)
|
|||
gboolean opc;
|
||||
|
||||
for (i = 0; i < SCPI_READ_RETRIES; i++) {
|
||||
opc = FALSE;
|
||||
sr_scpi_get_bool(scpi, SCPI_CMD_OPC, &opc);
|
||||
if (opc)
|
||||
return SR_OK;
|
||||
|
|
Loading…
Reference in New Issue