Skip to content

Commit

Permalink
Merge pull request #183 from us3r64/fix/socket-recv_into
Browse files Browse the repository at this point in the history
Fix double subtraction of bytes_read from num_to_read in recv_into
  • Loading branch information
dhalbert authored Jan 15, 2024
2 parents 1f35b4a + a63118b commit c69b6f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adafruit_esp32spi/adafruit_esp32spi_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c69b6f2

Please sign in to comment.