fix -Wdangling-else warnings
authorAndre Heider <a.heider@gmail.com>
Wed, 23 Nov 2022 13:43:13 +0000 (14:43 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 15 Dec 2022 19:07:49 +0000 (20:07 +0100)
It's less confusing with braces.

Signed-off-by: Andre Heider <a.heider@gmail.com>
iwinfo_cli.c
iwinfo_lua.c

index 1ca899909d736b8acb96bb5ca81095fe766f6c19..b533ffe96fefa36ae2b8b1548a9b71c661971a3f 100644 (file)
@@ -254,10 +254,12 @@ static char * format_encryption(struct iwinfo_crypto_entry *c)
 
                        for (i = 0; i < 3; i++)
                                if (c->wpa_version & (1 << i))
+                               {
                                        if (i)
                                                pos += sprintf(pos, "WPA%d/", i + 1);
                                        else
                                                pos += sprintf(pos, "WPA/");
+                               }
 
                        pos--;
 
index 996f2911e2755c4c3279e08833fa55153bab72b9..ecf257d67678331425bbc2a8a496d20ba038a060 100644 (file)
@@ -155,10 +155,12 @@ static char * iwinfo_crypto_desc(struct iwinfo_crypto_entry *c)
 
                                for (i = 0; i < 3; i++)
                                        if (c->wpa_version & (1 << i))
+                                       {
                                                if (i)
                                                        pos += sprintf(pos, "WPA%d/", i + 1);
                                                else
                                                        pos += sprintf(pos, "WPA/");
+                                       }
 
                                pos--;