mirror of
https://github.com/MidnightCommander/mc
synced 2025-04-13 02:22:51 +03:00
* view.c: Fixed an integer wraparound bug.
This commit is contained in:
parent
0979ed9626
commit
c534a510c7
@ -15,6 +15,7 @@
|
|||||||
* help.c: Likewise.
|
* help.c: Likewise.
|
||||||
* layout.c: Likewise.
|
* layout.c: Likewise.
|
||||||
* view.c: Likewise.
|
* view.c: Likewise.
|
||||||
|
* view.c: Fixed an integer wraparound bug.
|
||||||
|
|
||||||
2005-06-08 Roland Illig <roland.illig@gmx.de>
|
2005-06-08 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
|
10
src/view.c
10
src/view.c
@ -1103,9 +1103,13 @@ static void
|
|||||||
view_move_up (WView *view, offset_type lines)
|
view_move_up (WView *view, offset_type lines)
|
||||||
{
|
{
|
||||||
if (view->hex_mode) {
|
if (view->hex_mode) {
|
||||||
if (view->hex_cursor >= lines * view->bytes_per_line) {
|
offset_type bytes = lines * view->bytes_per_line;
|
||||||
view->hex_cursor -= lines * view->bytes_per_line;
|
if (view->hex_cursor >= bytes) {
|
||||||
view->dpy_topleft -= lines * view->bytes_per_line;
|
view->hex_cursor -= bytes;
|
||||||
|
if (view->dpy_topleft >= bytes)
|
||||||
|
view->dpy_topleft -= bytes;
|
||||||
|
else
|
||||||
|
view->dpy_topleft = 0;
|
||||||
} else {
|
} else {
|
||||||
view->hex_cursor %= view->bytes_per_line;
|
view->hex_cursor %= view->bytes_per_line;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user