updated for version 7.1-119
diff --git a/src/option.c b/src/option.c
index 59a2fa3..0bdc0a4 100644
--- a/src/option.c
+++ b/src/option.c
@@ -7824,6 +7824,8 @@
 	    errmsg = e_positive;
 	    p_ch = 1;
 	}
+	if (p_ch > Rows - min_rows() + 1)
+	    p_ch = Rows - min_rows() + 1;
 
 	/* Only compute the new window layout when startup has been
 	 * completed. Otherwise the frame sizes may be wrong. */