From 5ba5ccb71244541f3df795a22ebe79d0eb5e4f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cabe=CC=81?= Date: Mon, 19 Dec 2016 17:18:27 +0100 Subject: [PATCH] fix for issue #252: bug in MicroBitUARTService#read when buffer contains NULL character MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Benjamin Cabé --- source/bluetooth/MicroBitUARTService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++;