From aff94d065e3ef50fa022b3e79b0dc435ae2c5b0a Mon Sep 17 00:00:00 2001 From: Martin Lederhilger Date: Mon, 7 Sep 2015 22:43:20 +0200 Subject: [PATCH] scpi: Fix incorrect serial_read_nonblocking call(). There was a problem in scpi_serial.c in the scpi_serial_read_data() function. Incoming data was written at the read position in the buffer, although it should be written at the count position in the buffer. --- src/scpi/scpi_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scpi/scpi_serial.c b/src/scpi/scpi_serial.c index 9522c297..cad41381 100644 --- a/src/scpi/scpi_serial.c +++ b/src/scpi/scpi_serial.c @@ -162,7 +162,7 @@ static int scpi_serial_read_data(void *priv, char *buf, int maxlen) /* Try to read new data into the buffer if there is space. */ if (len > 0) { - ret = serial_read_nonblocking(sscpi->serial, sscpi->buffer + sscpi->read, + ret = serial_read_nonblocking(sscpi->serial, sscpi->buffer + sscpi->count, BUFFER_SIZE - sscpi->count); if (ret < 0)