https://git.reactos.org/?p=reactos.git;a=commitdiff;h=194180b1be60d959c7e14a92dd2ef6cbe1061354

commit 194180b1be60d959c7e14a92dd2ef6cbe1061354
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Sun Apr 28 17:22:34 2019 +0200
Commit:     HervĂ© Poussineau <[email protected]>
CommitDate: Mon May 27 13:54:08 2019 +0200

    [TELNET] Add missing curly braces to for-statement
    
    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--)
             ^~~
---
 base/applications/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 25bf556914..41541a8bb5 100644
--- a/base/applications/network/telnet/src/tnmain.cpp
+++ b/base/applications/network/telnet/src/tnmain.cpp
@@ -168,14 +168,18 @@ struct cmdHistory * cfgets (char *buf, unsigned int 
length, struct cmdHistory *c
                                                
if(InputRecord.Event.KeyEvent.dwControlKeyState &
                                                        (LEFT_CTRL_PRESSED | 
RIGHT_CTRL_PRESSED)) {
                                                        int j, k;
-                                                       for (j = cursor; j >= 
0; j--)
-                                                               if (buf[j-1] != 
' ')
-                                                                       break;
-                                                               for (k = --j; k 
>= 0; k--)
-                                                                       if 
(buf[k] == ' ' || k == 0) {
-                                                                               
cursor = !k ? k : ++k;
-                                                                               
break;
-                                                                       }
+                            for (j = cursor; j >= 0; j--)
+                            {
+                                if (buf[j - 1] != ' ')
+                                    break;
+                                for (k = --j; k >= 0; k--)
+                                {
+                                    if (buf[k] == ' ' || k == 0) {
+                                        cursor = !k ? k : ++k;
+                                        break;
+                                    }
+                                }
+                            }
                                                } else
                                                        cursor--;
                                                MustRefresh = 1;

Reply via email to