https://git.reactos.org/?p=reactos.git;a=commitdiff;h=454745e48ca3b583e9d6e1...
commit 454745e48ca3b583e9d6e1e70a9be418f490a88d Author: Timo Kreuzer timo.kreuzer@reactos.org AuthorDate: Sun Apr 28 17:20:02 2019 +0200 Commit: Hervé Poussineau hpoussin@reactos.org CommitDate: Mon May 27 13:54:08 2019 +0200
[TELNET] Add missing curly braces to while-statement
Fixes GCC 8 warning: base/applications/network/telnet/src/tmapldr.cpp:70:3: error: this 'while' clause does not guard... [-Werror=misleading-indentation] while (buf[len]) ^~~~~ base/applications/network/telnet/src/tmapldr.cpp:74:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while' if (len && (buf[len-1] == ' ')) { ^~ --- base/applications/network/telnet/src/tmapldr.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/base/applications/network/telnet/src/tmapldr.cpp b/base/applications/network/telnet/src/tmapldr.cpp index 99b3b62062..ef1ada0dc6 100644 --- a/base/applications/network/telnet/src/tmapldr.cpp +++ b/base/applications/network/telnet/src/tmapldr.cpp @@ -67,18 +67,20 @@ static char * getline(istream& i, char* buf, int size){ if ((buf[0]==0)||(buf[0]==';')) continue;
len = 0; // look for comment like this one - while (buf[len]) - if ((buf[len] == '/') && (buf[len+1] == '/')) buf[len] = 0; - else len++; + while (buf[len]) + { + if ((buf[len] == '/') && (buf[len + 1] == '/')) buf[len] = 0; + else len++;
- if (len && (buf[len-1] == ' ')) { + if (len && (buf[len - 1] == ' ')) { len--; - buf[len]=0; - }; - // in case for comment like this one (in line just a comment) - if (buf[0]==0) continue; + buf[len] = 0; + }; + } + // in case for comment like this one (in line just a comment) + if (buf[0] == 0) continue;
- break; + break; }; return (buf); };