changeset 3356:09759a9653c5

(calculate_scrolling): Defend against negative baud_rate.
author Richard M. Stallman <rms@gnu.org>
date Mon, 31 May 1993 19:04:07 +0000
parents e0c2e8a2ef75
children d9523a958b3c
files src/scroll.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/scroll.c	Mon May 31 18:33:08 1993 +0000
+++ b/src/scroll.c	Mon May 31 19:04:07 1993 +0000
@@ -108,6 +108,9 @@
      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;