diff --git a/adafruit_esp32spi/adafruit_esp32spi_socket.py b/adafruit_esp32spi/adafruit_esp32spi_socket.py index 1cf379f..fa3a082 100644 --- a/adafruit_esp32spi/adafruit_esp32spi_socket.py +++ b/adafruit_esp32spi/adafruit_esp32spi_socket.py @@ -121,7 +121,7 @@ def recv_into(self, buffer, nbytes: int = 0): ) buffer[num_read : num_read + len(bytes_read)] = bytes_read num_read += len(bytes_read) - num_to_read -= num_read + num_to_read -= len(bytes_read) elif num_read > 0: # We got a message, but there are no more bytes to read, so we can stop. break