aboutsummaryrefslogtreecommitdiff
path: root/vt.c
diff options
context:
space:
mode:
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/vt.c b/vt.c
index 3ce99250..8899fc74 100644
--- a/vt.c
+++ b/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;