diff options
author | Alexander Naumov <alexander_naumov@opensuse.org> | 2017-01-21 03:03:11 +0100 |
---|---|---|
committer | Alexander Naumov <alexander_naumov@opensuse.org> | 2017-01-21 03:03:11 +0100 |
commit | 9054e9fc4a3514e717152aaf6464863a5cfdd306 (patch) | |
tree | 2a02d3e4169012488af813dc85de861d9c374288 | |
parent | bd37ae4f27c02fc103ba14e5103ed92cc58488a4 (diff) | |
download | screen-9054e9fc4a3514e717152aaf6464863a5cfdd306.tar.gz |
Division by zero! Solution needed
-rw-r--r-- | src/canvas.c | 7 |
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; |