From 2b2fbbb630422c4ed05aba816d9e8a53cc476e73 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Wed, 30 Aug 2017 16:06:22 +0200 Subject: [PATCH] nimble/monitor: Fix ble_monitor_out It skipped character when breaking line on full buffer. X-Original-Commit: 5f5f286b4881abb142c9256be122cbe5d3fc7459 --- nimble/host/src/ble_monitor.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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';