fix -Wdangling-else warnings

It's less confusing with braces.

Signed-off-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
Andre Heider 2022-11-23 14:43:13 +01:00 committed by Jo-Philipp Wich
parent 4aa6c5a45c
commit d6381634c2
2 changed files with 4 additions and 0 deletions

View file

@ -254,10 +254,12 @@ static char * format_encryption(struct iwinfo_crypto_entry *c)
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
if (c->wpa_version & (1 << i)) if (c->wpa_version & (1 << i))
{
if (i) if (i)
pos += sprintf(pos, "WPA%d/", i + 1); pos += sprintf(pos, "WPA%d/", i + 1);
else else
pos += sprintf(pos, "WPA/"); pos += sprintf(pos, "WPA/");
}
pos--; pos--;

View file

@ -155,10 +155,12 @@ static char * iwinfo_crypto_desc(struct iwinfo_crypto_entry *c)
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
if (c->wpa_version & (1 << i)) if (c->wpa_version & (1 << i))
{
if (i) if (i)
pos += sprintf(pos, "WPA%d/", i + 1); pos += sprintf(pos, "WPA%d/", i + 1);
else else
pos += sprintf(pos, "WPA/"); pos += sprintf(pos, "WPA/");
}
pos--; pos--;