]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix broken dir read from pipe
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 6 May 2020 13:33:29 +0000 (19:03 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 6 May 2020 13:33:29 +0000 (19:03 +0530)
src/nnn.c

index 0bafe234c5cf9c3b940358272da1da5d83c058c5..17199cd343eb5071915594b16c3c78cfa773ca1c 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4273,6 +4273,8 @@ static void readpipe(int fd, char **path, char **lastname, char **lastdir)
                if (len <= 0)
                        return;
 
+               /* Terminate the path read */
+               g_buf[len] = '\0';
                nextpath = g_buf;
        } else if (op == 'l') {
                /* Remove last list mode path, if any */