From fdf221cb175fc12c6784bd4e9fbda64d69dbb11b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 28 Apr 2019 17:05:33 +0200 Subject: [PATCH] [TELNET] Add missing curly braces to if-statelent Fixes GCC 8 warning: base/applications/network/telnet/src/tnmain.cpp:171:8: error: this 'for' clause does not guard... [-Werror=misleading-indentation] for (j = cursor; j >= 0; j--) ^~~ base/applications/network/telnet/src/tnmain.cpp:174:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for' for (k = --j; k >= 0; k--) ^~~ --- .../network/telnet/src/tnmain.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/base/applications/network/telnet/src/tnmain.cpp b/base/applications/network/telnet/src/tnmain.cpp index d930dc1189a..25bf5569145 100644 --- a/base/applications/network/telnet/src/tnmain.cpp +++ b/base/applications/network/telnet/src/tnmain.cpp @@ -146,14 +146,18 @@ struct cmdHistory * cfgets (char *buf, unsigned int length, struct cmdHistory *c if (InputRecord.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) { unsigned int j, k; - for (j = cursor; j <= current; j++) - if (buf[j+1] == ' ' || (j+1)==current) - break; - for (k = ++j; k <= current; k++) - if (buf[k] != ' ' || k == current) { - cursor = k == current ? --k : k; - break; - } + for (j = cursor; j <= current; j++) + { + if (buf[j + 1] == ' ' || (j + 1) == current) + break; + for (k = ++j; k <= current; k++) + { + if (buf[k] != ' ' || k == current) { + cursor = k == current ? --k : k; + break; + } + } + } } else cursor++; MustRefresh = 1;