[cli-uart] save space for NULL terminator in rx buffer (#3500)

This commit is contained in:
Jonathan Hui
2019-01-23 21:50:56 -08:00
committed by GitHub
parent aa5673cd48
commit 4ca58d440d
+1 -1
View File
@@ -200,7 +200,7 @@ void Uart::ReceiveTask(const uint8_t *aBuf, uint16_t aBufLength)
break;
default:
if (mRxLength < kRxBufferSize)
if (mRxLength < kRxBufferSize - 1)
{
Output(reinterpret_cast<const char *>(aBuf), 1);
mRxBuffer[mRxLength++] = static_cast<char>(*aBuf);