aboutsummaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/commands.c b/commands.c
index 19d2abe..5f523ba 100644
--- a/commands.c
+++ b/commands.c
@@ -273,10 +273,7 @@ bool ci_navigate(arg_t n)
if (prefix > 0)
n *= prefix;
n += fileidx;
- if (n < 0)
- n = 0;
- if (n >= filecnt)
- n = filecnt - 1;
+ n = MAX(0, MIN(n, filecnt - 1));
if (n != fileidx) {
load_image(n);