mirror of
https://github.com/joel16/VitaShell.git
synced 2025-02-17 02:18:41 +00:00
check lower bounds when skipping page down
This commit is contained in:
parent
f81c80b2a1
commit
47a6d0b626
4
text.c
4
text.c
@ -317,8 +317,8 @@ int textViewer(char *file) {
|
||||
} else { // Skip page down
|
||||
base_pos = base_pos + MAX_ENTRIES;
|
||||
if (base_pos >= n_lines - MAX_POSITION) {
|
||||
base_pos = n_lines - MAX_POSITION;
|
||||
rel_pos = MAX_POSITION - 1;
|
||||
base_pos = MAX(n_lines - MAX_POSITION, 0);
|
||||
rel_pos = MIN(MAX_POSITION - 1, n_lines-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user