Skip to content

Commit

Permalink
Fix off-by-one error causing out of bounds indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-x90 committed May 26, 2024
1 parent 521198c commit 919e82a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lineage_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ void LineageCamera::fillButtonContainers(Cell *cell) {
}
}
void LineageCamera::clearButtonContainers() {
for (int i = _parentButtonContainer->get_child_count(); i > 0; i--) {
for (int i = _parentButtonContainer->get_child_count() - 1; i > 0; i--) {
Node *button = _parentButtonContainer->get_child(i);
_parentButtonContainer->remove_child(button);
}
for (int i = _childButtonContainer->get_child_count(); i > 0; i--) {
for (int i = _childButtonContainer->get_child_count() - 1; i > 0; i--) {
Node *button = _childButtonContainer->get_child(i);
_childButtonContainer->remove_child(button);
}
Expand Down

0 comments on commit 919e82a

Please sign in to comment.