diff --git a/src/viewer/lib.c b/src/viewer/lib.c
index 46b12c9..bbac08e 100644
a
|
b
|
mcview_calc_percent (mcview_t * view, off_t p) |
430 | 430 | return (-1); |
431 | 431 | |
432 | 432 | filesize = mcview_get_filesize (view); |
| 433 | if (view->hex_mode && filesize > 0) { |
| 434 | /* p can't be beyond the last char, only over that. Compensate for this. */ |
| 435 | filesize--; |
| 436 | } |
433 | 437 | |
434 | | if (filesize == 0 || view->dpy_end == filesize) |
| 438 | if (filesize == 0 || p >= filesize) |
435 | 439 | percent = 100; |
436 | 440 | else if (p > (INT_MAX / 100)) |
437 | 441 | percent = p / (filesize / 100); |