comparison src/terminal.c @ 15203:aa877e0b7f62 v8.1.0611

patch 8.1.0611: crash when using terminal with long composing characters commit https://github.com/vim/vim/commit/a79fd56923744e331b3a5badbf9186100818fb45 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 20 20:47:32 2018 +0100 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 https://github.com/vim/vim/issues/3619, closes #3703)
author Bram Moolenaar <Bram@vim.org>
date Thu, 20 Dec 2018 21:00:07 +0100
parents 7903dce131d4
children de63593896b3
comparison
equal deleted inserted replaced
15202:9321e405a8fa 15203:aa877e0b7f62
1559 { 1559 {
1560 width = cell.width; 1560 width = cell.width;
1561 1561
1562 cell2cellattr(&cell, &p[pos.col]); 1562 cell2cellattr(&cell, &p[pos.col]);
1563 1563
1564 if (ga_grow(&ga, MB_MAXBYTES) == OK) 1564 // Each character can be up to 6 bytes.
1565 if (ga_grow(&ga, VTERM_MAX_CHARS_PER_CELL * 6) == OK)
1565 { 1566 {
1566 int i; 1567 int i;
1567 int c; 1568 int c;
1568 1569
1569 for (i = 0; (c = cell.chars[i]) > 0 || i == 0; ++i) 1570 for (i = 0; (c = cell.chars[i]) > 0 || i == 0; ++i)