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)
diff --git a/src/misc1.c b/src/misc1.c
index 7ef7e78..f5549fd 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -1447,9 +1447,9 @@
i = get_number(TRUE, mouse_used);
if (KeyTyped)
{
- /* don't call wait_return() now */
- /* msg_putchar('\n'); */
- cmdline_row = msg_row - 1;
+ // don't call wait_return() now
+ if (msg_row > 0)
+ cmdline_row = msg_row - 1;
need_wait_return = FALSE;
msg_didany = FALSE;
msg_didout = FALSE;