Skip to content
Permalink
Browse files

Merge pull request #253 from kartben/fix-uart-read

fix for issue #252: bug in MicroBitUARTService#read when buffer conta…
  • Loading branch information
finneyj committed Jan 6, 2017
2 parents aa1dab7 + 192c966 commit f569f5f6d16114aa7ad70e9c1ecee7cfce0eac39
Showing with 1 addition and 1 deletion.
  1. +1 −1 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(i < len && (c = getc(mode)) >= 0)
{
buf[i] = c;
i++;

0 comments on commit f569f5f

Please sign in to comment.
You can’t perform that action at this time.