dcs: put: don't append data if buffer resize failed

This commit is contained in:
Daniel Eklöf 2020-01-12 12:00:43 +01:00
parent a1ce31cd1d
commit a2652d2447
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

3
dcs.c
View file

@ -67,7 +67,8 @@ void
dcs_put(struct terminal *term, uint8_t c)
{
LOG_DBG("PUT: %c", c);
ensure_size(term, term->vt.dcs.idx + 1);
if (!ensure_size(term, term->vt.dcs.idx + 1))
return;
term->vt.dcs.data[term->vt.dcs.idx++] = c;
}