mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-27 06:46:44 -04:00
osc: allocate data buffer dynamically
This commit is contained in:
parent
95ff37afd7
commit
153628a217
5 changed files with 30 additions and 4 deletions
9
vt.c
9
vt.c
|
|
@ -909,12 +909,15 @@ action(struct terminal *term, enum action _action, uint8_t c)
|
|||
break;
|
||||
|
||||
case ACTION_OSC_PUT:
|
||||
if (term->vt.osc.idx < (int)sizeof(term->vt.osc.data) - 1)
|
||||
term->vt.osc.data[term->vt.osc.idx++] = c;
|
||||
if (!osc_ensure_size(term, term->vt.osc.idx + 1))
|
||||
break;
|
||||
|
||||
term->vt.osc.data[term->vt.osc.idx++] = c;
|
||||
break;
|
||||
|
||||
case ACTION_OSC_END:
|
||||
assert(term->vt.osc.idx < sizeof(term->vt.osc.data));
|
||||
if (!osc_ensure_size(term, term->vt.osc.idx + 1))
|
||||
break;
|
||||
term->vt.osc.data[term->vt.osc.idx] = '\0';
|
||||
osc_dispatch(term);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue