From f204a145c758e2700dfc62301e6e94a3594d8745 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 13 May 2016 10:35:19 +0200 Subject: [PATCH] POSIX: Improve console management --- src/platforms/posix/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/posix/main.cpp b/src/platforms/posix/main.cpp index fe12f233d3..278257fce6 100644 --- a/src/platforms/posix/main.cpp +++ b/src/platforms/posix/main.cpp @@ -329,13 +329,13 @@ int main(int argc, char **argv) } if (buf_ptr_write > 0) { - if (mystr != string_buffer[buf_ptr_write - 1]) { + if (!mystr.empty() && mystr != string_buffer[buf_ptr_write - 1]) { string_buffer[buf_ptr_write] = mystr; buf_ptr_write++; } } else { - if (mystr != string_buffer[CMD_BUFF_SIZE - 1]) { + if (!mystr.empty() && mystr != string_buffer[CMD_BUFF_SIZE - 1]) { string_buffer[buf_ptr_write] = mystr; buf_ptr_write++; }