aboutsummaryrefslogtreecommitdiffstats
path: root/display.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-11-26 16:57:39 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-11-26 16:57:39 +0000
commit7f473aa26278eb5b976a76ccef6bfafa09e54ae1 (patch)
tree33c353f5accca64c2d62f5270fab47bfca7f0ec4 /display.c
parentw3m 0.3.2.1 released (diff)
downloadw3m-7f473aa26278eb5b976a76ccef6bfafa09e54ae1.tar.gz
w3m-7f473aa26278eb5b976a76ccef6bfafa09e54ae1.zip
[w3m-dev 03486] fix of displayLineInfo
* display.c (displayBuffer): don't divide by 0 From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'display.c')
-rw-r--r--display.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/display.c b/display.c
index 4a09264..e6b8037 100644
--- a/display.c
+++ b/display.c
@@ -1,4 +1,4 @@
-/* $Id: display.c,v 1.39 2002/11/25 16:57:16 ukai Exp $ */
+/* $Id: display.c,v 1.40 2002/11/26 16:57:39 ukai Exp $ */
#include <signal.h>
#include "fm.h"
@@ -330,7 +330,7 @@ displayBuffer(Buffer *buf, int mode)
if (displayLineInfo && buf->currentLine != NULL && buf->lastLine != NULL) {
int cl = buf->currentLine->real_linenumber;
int ll = buf->lastLine->real_linenumber;
- int r = (int)((double)cl * 100.0 / (double)ll + 0.5);
+ int r = (int)((double)cl * 100.0 / (double)(ll ? ll : 1) + 0.5);
Strcat(msg, Sprintf("%d/%d (%d%%)", cl, ll, r));
}
else