Skip to content

Commit

Permalink
powermand: fix malformed conditional
Browse files Browse the repository at this point in the history
Problem: a conditional block was not enclosed in braces.

Clang found this one in CI:

client.c: In function ‘cli_pre_poll’:
client.c:1070:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
 1070 |         if (listen_fds[i] != NO_FD)
      |         ^~
client.c:1072:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
 1072 |             xpollfd_set(pfd, listen_fds[i], XPOLLIN);
      |             ^~~~~~~~~~~
  • Loading branch information
garlick committed May 2, 2023
1 parent c27a0b6 commit 026c6d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion powermand/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,10 @@ void cli_pre_poll(xpollfd_t pfd)
int i;

for (i = 0; i < listen_fds_len; i++) {
if (listen_fds[i] != NO_FD)
if (listen_fds[i] != NO_FD) {
assert(listen_fds[i] >= 0);
xpollfd_set(pfd, listen_fds[i], XPOLLIN);
}
}

itr = list_iterator_create(cli_clients);
Expand Down

0 comments on commit 026c6d4

Please sign in to comment.