From: Gerhard Sittig Date: Sat, 7 Jan 2017 20:16:33 +0000 (+0100) Subject: Revert "scpi: Don't process received data of zero length" X-Git-Tag: libsigrok-0.5.0~148 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d5a61aaf2d634c4558bda225e64e720104a0203f;p=libsigrok.git Revert "scpi: Don't process received data of zero length" Undo the change which skips management activities when no data was received. This change breaks the current implementation, and needs to get deferred until a delicate interaction between the resize and the read logic has been eliminated. --- diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c index f743f64d..f87bf9eb 100644 --- a/src/scpi/scpi.c +++ b/src/scpi/scpi.c @@ -448,9 +448,9 @@ SR_PRIV int sr_scpi_get_data(struct sr_scpi_dev_inst *scpi, return SR_ERR; } else if (len > 0) { laststart = g_get_monotonic_time(); - offset += len; - g_string_set_size(response, offset); } + offset += len; + g_string_set_size(response, offset); elapsed_ms = (g_get_monotonic_time() - laststart) / 1000; if (elapsed_ms >= scpi->read_timeout_ms) { sr_err("Timed out waiting for SCPI response.");