1
0
mirror of https://github.com/emersion/kanshi synced 2024-11-22 15:51:58 +01:00

Fix index in match_profile

This commit is contained in:
Simon Ser 2019-06-06 08:33:58 +03:00
parent 46d1b9feb8
commit 72498b95dc
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

6
main.c

@ -35,18 +35,20 @@ static bool match_profile(struct kanshi_state *state,
struct kanshi_profile_output *profile_output;
wl_list_for_each(profile_output, &profile->outputs, link) {
bool output_matched = false;
size_t i = 0;
ssize_t i = -1;
struct kanshi_head *head;
wl_list_for_each(head, &state->heads, link) {
i++;
if (matches[i] != NULL) {
continue; // already matched
}
if (match_profile_output(profile_output, head)) {
matches[i] = head;
output_matched = true;
break;
}
i++;
}
if (!output_matched) {