patch 8.1.0611: crash when using terminal with long composing characters
Problem: Crash when using terminal with long composing characters.
Solution: Make space for all characters. (Yasuhiro Matsumoto, closes #3619,
closes #3703)
diff --git a/src/terminal.c b/src/terminal.c
index 42897bf..5a01658 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1561,7 +1561,8 @@
cell2cellattr(&cell, &p[pos.col]);
- if (ga_grow(&ga, MB_MAXBYTES) == OK)
+ // Each character can be up to 6 bytes.
+ if (ga_grow(&ga, VTERM_MAX_CHARS_PER_CELL * 6) == OK)
{
int i;
int c;