Skip to content

Commit

Permalink
vscreens: resize: grow: last vscreen should be N-1 rather than N
Browse files Browse the repository at this point in the history
growing the number (set vscreens N) at runtime would always grow one
extra: new set of vscreens had the last one indexed at N, rather than
N-1.  this meant there was always one extra when we grew the vscreen
count.  the end must be shifted by one left.

conversely, shrinking already worked correctly: the new set of vscreens
would have the last one indexed at N-1
  • Loading branch information
smemsh authored and jcs committed Jul 14, 2024
1 parent 358d0b4 commit b777d1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ vscreens_resize(int n)
}
} else if (n > defaults.vscreens) {
list_for_each_entry(scr, &rp_screens, node) {
for (x = defaults.vscreens; x <= n; x++) {
for (x = defaults.vscreens; x < n; x++) {
cur = xmalloc(sizeof(rp_vscreen));
init_vscreen(cur, scr);
list_add_tail(&cur->node, &scr->vscreens);
Expand Down

0 comments on commit b777d1d

Please sign in to comment.