neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit e5a537c8858b369832942795edd9a5234aa659a5
parent 8e52d8a394799ede43ae5e80574f12dede9bc13e
Author: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date:   Sun, 22 Jan 2023 23:08:38 +0100

fix: use correct number for INT_MAX (#21951)

Actually use INT_MAX rather than a number to prevent these types of
situations to begin with.
Diffstat:
Msrc/nvim/getchar.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c @@ -886,7 +886,7 @@ int ins_typebuf(char *str, int noremap, int offset, bool nottyped, bool silent) // often. int newoff = MAXMAPLEN + 4; int extra = addlen + newoff + 4 * (MAXMAPLEN + 4); - if (typebuf.tb_len > 2147483674 - extra) { + if (typebuf.tb_len > INT_MAX - extra) { // string is getting too long for 32 bit int emsg(_(e_toocompl)); // also calls flush_buffers setcursor();