Skip to content

Commit f02b6ff

Browse files
committed
Quieten -Wempty-body with equivalent while loop
Although correct, the empty for loop is a bit misleading. Don't disable -Wempty-body because it's actually useful. Sprinkling the code with pragmas to disable a certain warning for a certain compiler is not a good idea either.
1 parent 5d944c6 commit f02b6ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/conf.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,10 @@ void parse_trusted_mac_list(const char *ptr) {
863863
config.trustedmaclist->next = NULL;
864864
} else {
865865
/* Advance to the last entry */
866-
for (p = config.trustedmaclist; p->next != NULL; p = p->next);
866+
p = config.trustedmaclist;
867+
while (p->next != NULL) {
868+
p = p->next;
869+
}
867870
p->next = safe_malloc(sizeof(t_trusted_mac));
868871
p = p->next;
869872
p->mac = safe_strdup(mac);

0 commit comments

Comments
 (0)