summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Naumov <alexander_naumov@opensuse.org>2017-01-21 03:03:11 +0100
committerAlexander Naumov <alexander_naumov@opensuse.org>2017-01-21 03:03:11 +0100
commit9054e9fc4a3514e717152aaf6464863a5cfdd306 (patch)
tree2a02d3e4169012488af813dc85de861d9c374288
parentbd37ae4f27c02fc103ba14e5103ed92cc58488a4 (diff)
downloadscreen-9054e9fc4a3514e717152aaf6464863a5cfdd306.tar.gz
Division by zero! Solution needed
-rw-r--r--src/canvas.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/canvas.c b/src/canvas.c
index 9865182..7a31b0a 100644
--- a/src/canvas.c
+++ b/src/canvas.c
@@ -586,7 +586,12 @@ struct canvas *cv;
}
else
{
- int hx = need * (hh - m - 1) / got;
+ int hx = 1; //FIXME Division by zero (got) is posible. "hx = 1" is random number here!!!
+ if (got != 0)
+ hx = need * (hh - m - 1) / got;
+ else
+ debug(" got = 0\n");
+
debug3(" -> %d - %d = %d\n", hh, hx, hh - hx);
got -= (hh - m - 1);
hh -= hx;