1
0
mirror of https://github.com/emersion/kanshi synced 2024-11-23 00:02:16 +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; struct kanshi_profile_output *profile_output;
wl_list_for_each(profile_output, &profile->outputs, link) { wl_list_for_each(profile_output, &profile->outputs, link) {
bool output_matched = false; bool output_matched = false;
size_t i = 0; ssize_t i = -1;
struct kanshi_head *head; struct kanshi_head *head;
wl_list_for_each(head, &state->heads, link) { wl_list_for_each(head, &state->heads, link) {
i++;
if (matches[i] != NULL) { if (matches[i] != NULL) {
continue; // already matched continue; // already matched
} }
if (match_profile_output(profile_output, head)) { if (match_profile_output(profile_output, head)) {
matches[i] = head; matches[i] = head;
output_matched = true; output_matched = true;
break; break;
} }
i++;
} }
if (!output_matched) { if (!output_matched) {