diff --git a/nimble/host/src/ble_monitor.c b/nimble/host/src/ble_monitor.c index 89e6ee800..1585ab515 100644 --- a/nimble/host/src/ble_monitor.c +++ b/nimble/host/src/ble_monitor.c @@ -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';