From ca285807466fdf83a4ce2431ac9277227d6cdbb7 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 18 Dec 2017 00:00:08 +0530 Subject: [PATCH] NAME_MAX does not include NULL char --- nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nnn.c b/nnn.c index 77a099e5..abbcc0f0 100644 --- a/nnn.c +++ b/nnn.c @@ -1855,7 +1855,7 @@ dentfill(char *path, struct entry **dents, } dentp = &(*dents)[n]; - xstrlcpy(pnamebuf[n].pname, namep, NAME_MAX); + xstrlcpy(pnamebuf[n].pname, namep, NAME_MAX + 1); dentp->name = pnamebuf[n].pname; dentp->mode = sb.st_mode;