Fix regression from 08d87405d0

This commit is contained in:
Arun Prakash Jana 2017-05-15 10:18:33 +05:30
parent 20216a995b
commit 463c270caf
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 7 additions and 6 deletions

13
nnn.c
View File

@ -1079,13 +1079,14 @@ show_stats(char* fpath, char* fname, struct stat *sb)
/* Show file name or 'symlink' -> 'target' */ /* Show file name or 'symlink' -> 'target' */
if (perms[0] == 'l') { if (perms[0] == 'l') {
char symtgt[PATH_MAX]; /* Note that MAX_CMD_LEN > PATH_MAX */
ssize_t len = readlink(fpath, symtgt, PATH_MAX); ssize_t len = readlink(fpath, g_buf, MAX_CMD_LEN);
if (len != -1) { if (len != -1) {
symtgt[len] = '\0'; g_buf[len] = '\0';
dprintf(fd, " File: '%s' -> '%s'", dprintf(fd, " File: '%s' -> ",
replace_escape(fname), replace_escape(fname));
replace_escape(symtgt)); dprintf(fd, "'%s'",
replace_escape(g_buf));
} }
} else } else
dprintf(fd, " File: '%s'", replace_escape(fname)); dprintf(fd, " File: '%s'", replace_escape(fname));