]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Avoid -Wmisleading-indentation warnings with GCC 6.
authorColin Watson <cjwatson@debian.org>
Thu, 28 Jan 2016 21:19:41 +0000 (21:19 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 29 Feb 2016 19:59:36 +0000 (19:59 +0000)
GCC 6 warns about potentially misleading indentation, such as:

    if (condition) stmt1; stmt2;

Chaining multiple ifs on a single line runs into this warning, even if
it's probably not actually misleading to a human eye, so just add a
couple of newlines to pacify the compiler.

(cherry picked from commit d700c33422926dda1b4af90bf1fcd262b03cfca8)

cproxy.c
proxy.c

index 934ce3dc228d6f26f5f66d9074e6b11327afd6ca..8c8a50cb53628ba9802beb97bf504d1f2c59caae 100644 (file)
--- a/cproxy.c
+++ b/cproxy.c
@@ -173,7 +173,8 @@ int proxy_socks5_selectchap(Proxy_Socket p)
        chapbuf[5] = '\x02'; /* Second attribute - username */
 
        ulen = strlen(username);
-       if (ulen > 255) ulen = 255; if (ulen < 1) ulen = 1;
+       if (ulen > 255) ulen = 255;
+       if (ulen < 1) ulen = 1;
 
        chapbuf[6] = ulen;
        memcpy(chapbuf+7, username, ulen);
diff --git a/proxy.c b/proxy.c
index 51754dc304a2e8e4f8db2c8dfd644c7940337301..cf45e1b79fe178b926eb58364f0db1b451ed9069 100644 (file)
--- a/proxy.c
+++ b/proxy.c
@@ -1188,9 +1188,11 @@ int proxy_socks5_negotiate (Proxy_Socket p, int change)
                char userpwbuf[255 + 255 + 3];
                int ulen, plen;
                ulen = strlen(username);
-               if (ulen > 255) ulen = 255; if (ulen < 1) ulen = 1;
+               if (ulen > 255) ulen = 255;
+               if (ulen < 1) ulen = 1;
                plen = strlen(password);
-               if (plen > 255) plen = 255; if (plen < 1) plen = 1;
+               if (plen > 255) plen = 255;
+               if (plen < 1) plen = 1;
                userpwbuf[0] = 1;      /* version number of subnegotiation */
                userpwbuf[1] = ulen;
                memcpy(userpwbuf+2, username, ulen);