mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-02 07:15:31 -04:00
vt: bug: fix lazy initialization of sub parameter value (off-by-one)
This commit is contained in:
parent
9b74cedb20
commit
0c5a19f950
1 changed files with 1 additions and 2 deletions
3
vt.c
3
vt.c
|
|
@ -887,8 +887,7 @@ action(struct terminal *term, enum action _action, uint8_t c)
|
||||||
term->vt.params.v[term->vt.params.idx - 1].sub.value[0] = 0;
|
term->vt.params.v[term->vt.params.idx - 1].sub.value[0] = 0;
|
||||||
} else if (c == ':') {
|
} else if (c == ':') {
|
||||||
struct vt_param *param = &term->vt.params.v[term->vt.params.idx - 1];
|
struct vt_param *param = &term->vt.params.v[term->vt.params.idx - 1];
|
||||||
param->sub.idx++;
|
param->sub.value[param->sub.idx++] = 0;
|
||||||
param->sub.value[param->sub.idx] = 0;
|
|
||||||
} else {
|
} else {
|
||||||
assert(term->vt.params.idx >= 0);
|
assert(term->vt.params.idx >= 0);
|
||||||
struct vt_param *param = &term->vt.params.v[term->vt.params.idx - 1];
|
struct vt_param *param = &term->vt.params.v[term->vt.params.idx - 1];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue