aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 0b0948373a..387b90395f 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -7,6 +7,7 @@
*/
#define EXTERN
+#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <string.h>
@@ -293,7 +294,8 @@ int main(int argc, char **argv)
if (params.diff_mode)
diff_win_options(firstwin, FALSE);
- cmdline_row = Rows - p_ch;
+ assert(p_ch >= 0 && Rows >= p_ch && Rows - p_ch <= INT_MAX);
+ cmdline_row = (int)(Rows - p_ch);
msg_row = cmdline_row;
screenalloc(false); /* allocate screen buffers */
set_init_2();