From 608fbb4ad75d9d1868f06a4cd849b48abd77d6e7 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 11 Dec 2022 02:53:34 +0530 Subject: [PATCH] Fix length calculation --- src/nnn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index 597869ce..89235b44 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -8573,8 +8573,10 @@ int main(int argc, char *argv[]) DPRINTF_S(arg); size_t len = xstrlen(arg); - if (len > 7 && is_prefix(arg, "file://", 7)) + if (len > 7 && is_prefix(arg, "file://", 7)) { arg = arg + 7; + len -= 7; + } initpath = abspath(arg, NULL, NULL); DPRINTF_S(initpath); if (!initpath) {