Merge branch 'fanalyzer-fix' into 'master'

GCC static analyzer misc fixes

See merge request wlroots/wlroots!4637
This commit is contained in:
Simon Zeni 2024-06-12 17:33:31 +00:00
commit 52730a2f1e
17 changed files with 57 additions and 6 deletions

View file

@ -40,6 +40,7 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
size_t ring = 0;
for (size_t i = 0; i < pad->ring_count; ++i) {
if (libinput_tablet_pad_mode_group_has_ring(li_group, i)) {
assert(ring < group->ring_count);
group->rings[ring++] = i;
}
}
@ -53,9 +54,11 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
if (group->strips == NULL) {
goto group_fail;
}
size_t strip = 0;
for (size_t i = 0; i < pad->strip_count; ++i) {
if (libinput_tablet_pad_mode_group_has_strip(li_group, i)) {
assert(strip < group->strip_count);
group->strips[strip++] = i;
}
}
@ -69,9 +72,11 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
if (group->buttons == NULL) {
goto group_fail;
}
size_t button = 0;
for (size_t i = 0; i < pad->button_count; ++i) {
if (libinput_tablet_pad_mode_group_has_button(li_group, i)) {
assert(button < group->button_count);
group->buttons[button++] = i;
}
}