nimble/monitor: Fix ble_monitor_out

It skipped character when breaking line on full buffer.

X-Original-Commit: 5f5f286b4881abb142c9256be122cbe5d3fc7459
This commit is contained in:
Andrzej Kaczmarek
2017-09-01 11:32:45 +02:00
parent 10f74813fd
commit 2b2fbbb630
+5 -2
View File
@@ -345,9 +345,12 @@ ble_monitor_out(int c)
static char buf[MYNEWT_VAL(BLE_MONITOR_CONSOLE_BUFFER_SIZE)];
static size_t len;
if (c != '\n' && len < sizeof(buf) - 1) {
if (c != '\n') {
buf[len++] = c;
return c;
if (len < sizeof(buf) - 1) {
return c;
}
}
buf[len++] = '\0';