diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2017-05-15 10:18:33 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2017-05-15 10:18:33 +0530 |
commit | 463c270caf8034da9ee02bd6ba2a1d4f3057ae30 (patch) | |
tree | 6289cdc176f05a095e285e6334fbe6366ae3d6ca | |
parent | 20216a995b8b446ef53baf9db64639afd9538131 (diff) | |
download | nnn-463c270caf8034da9ee02bd6ba2a1d4f3057ae30.tar.gz |
Fix regression from 08d87405d09d5667f6a3e90703f289bb5c30521c
-rw-r--r-- | nnn.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1079,13 +1079,14 @@ show_stats(char* fpath, char* fname, struct stat *sb) /* Show file name or 'symlink' -> 'target' */ if (perms[0] == 'l') { - char symtgt[PATH_MAX]; - ssize_t len = readlink(fpath, symtgt, PATH_MAX); + /* Note that MAX_CMD_LEN > PATH_MAX */ + ssize_t len = readlink(fpath, g_buf, MAX_CMD_LEN); if (len != -1) { - symtgt[len] = '\0'; - dprintf(fd, " File: '%s' -> '%s'", - replace_escape(fname), - replace_escape(symtgt)); + g_buf[len] = '\0'; + dprintf(fd, " File: '%s' -> ", + replace_escape(fname)); + dprintf(fd, "'%s'", + replace_escape(g_buf)); } } else dprintf(fd, " File: '%s'", replace_escape(fname)); |