aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-01-22 23:08:38 +0100
committerGitHub <noreply@github.com>2023-01-23 06:08:38 +0800
commite5a537c8858b369832942795edd9a5234aa659a5 (patch)
treeaae00f6ab30f92ec2690a961017b4778b3948662
parent8e52d8a394799ede43ae5e80574f12dede9bc13e (diff)
downloadrneovim-e5a537c8858b369832942795edd9a5234aa659a5.tar.gz
rneovim-e5a537c8858b369832942795edd9a5234aa659a5.tar.bz2
rneovim-e5a537c8858b369832942795edd9a5234aa659a5.zip
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.
-rw-r--r--src/nvim/getchar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index c25bce1668..9c5364e1b1 100644
--- 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();