]> Sergey Matveev's repositories - nnn.git/commitdiff
NAME_MAX does not include NULL char
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 17 Dec 2017 18:30:08 +0000 (00:00 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 17 Dec 2017 18:30:08 +0000 (00:00 +0530)
nnn.c

diff --git a/nnn.c b/nnn.c
index 77a099e5f899703276068db034e1e4759b893b37..abbcc0f0634d9d6b9286770799a42413b1f3f4de 100644 (file)
--- 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;