summaryrefslogtreecommitdiff
path: root/src/scroll.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-05-31 19:04:07 +0000
committerRichard M. Stallman <rms@gnu.org>1993-05-31 19:04:07 +0000
commit7a1ab3edf996b39aff04e6dbca25b0f117cdd8f9 (patch)
treed528c1ac3b332a5bfbaa7865e42cb4ab0d7ba5a5 /src/scroll.c
parent3700e407ff6fcd4e1afc82b846bbe1214c16dd07 (diff)
downloademacs-7a1ab3edf996b39aff04e6dbca25b0f117cdd8f9.tar.gz
(calculate_scrolling): Defend against negative baud_rate.
Diffstat (limited to 'src/scroll.c')
-rw-r--r--src/scroll.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/scroll.c b/src/scroll.c
index c4882cd091f..3f2724380b3 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -108,6 +108,9 @@ calculate_scrolling (frame, matrix, window_size, lines_below,
at least 1/4 second. */
int extra_cost = baud_rate / (10 * 4 * FRAME_HEIGHT (frame));
+ if (baud_rate <= 0)
+ extra_cost = 1;
+
/* initialize the top left corner of the matrix */
matrix->writecost = 0;
matrix->insertcost = INFINITY;