diff --git a/source/bluetooth/MicroBitUARTService.cpp b/source/bluetooth/MicroBitUARTService.cpp index 44a953b..b9b6f62 100644 --- a/source/bluetooth/MicroBitUARTService.cpp +++ b/source/bluetooth/MicroBitUARTService.cpp @@ -356,7 +356,7 @@ int MicroBitUARTService::read(uint8_t *buf, int len, MicroBitSerialMode mode) { int c; - while((c = getc(mode)) > 0 && i < len) + while((c = getc(mode)) >= 0 && i < len) { buf[i] = c; i++;