From 7fb08f691ea45f8e1593497a85478ba52bf95a1e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 31 May 1993 19:04:07 +0000 Subject: [PATCH] (calculate_scrolling): Defend against negative baud_rate. --- src/scroll.c | 3 +++ 1 file changed, 3 insertions(+) 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;