Skip to content

Commit 954bb06

Browse files
committed
patch 8.1.1509: cmdline_row can become negative, causing a crash
Problem: Cmdline_row can become negative, causing a crash. Solution: Make sure cmdline_row does not become negagive. (closes #4102)
1 parent 541faf7 commit 954bb06

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/misc1.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,9 +1447,9 @@ prompt_for_number(int *mouse_used)
14471447
i = get_number(TRUE, mouse_used);
14481448
if (KeyTyped)
14491449
{
1450-
/* don't call wait_return() now */
1451-
/* msg_putchar('\n'); */
1452-
cmdline_row = msg_row - 1;
1450+
// don't call wait_return() now
1451+
if (msg_row > 0)
1452+
cmdline_row = msg_row - 1;
14531453
need_wait_return = FALSE;
14541454
msg_didany = FALSE;
14551455
msg_didout = FALSE;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ static char *(features[]) =
777777

778778
static int included_patches[] =
779779
{ /* Add new patch number below this line */
780+
/**/
781+
1509,
780782
/**/
781783
1508,
782784
/**/

0 commit comments

Comments
 (0)