mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-06-30 13:14:56 -04:00
csi: clamp REP count to scrollback-lines * cols
This can be quite a lot, but hopefully less than 0x7fffffff, which is the max value a VT parameter can have... Closes #2366
This commit is contained in:
parent
01b3e7ed92
commit
e24ad0a793
1 changed files with 2 additions and 1 deletions
3
csi.c
3
csi.c
|
|
@ -798,7 +798,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
* ECMA-48, the behaviour is undefined if REP was
|
||||
* _not_ preceded by a graphical character.
|
||||
*/
|
||||
int count = vt_param_get(term, 0, 1);
|
||||
const size_t max_count = term->grid->num_rows * term->cols;
|
||||
int count = min(vt_param_get(term, 0, 1), max_count);
|
||||
LOG_DBG("REP: '%lc' %d times", (wint_t)term->vt.last_printed, count);
|
||||
|
||||
int width;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue