mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Guard against name length
This commit is contained in:
parent
d3d9d1ed3a
commit
5a92f647f4
4
nnn.c
4
nnn.c
|
@ -2406,7 +2406,7 @@ static void redraw(char *path)
|
||||||
/* We need to show filename as it may be truncated in directory listing */
|
/* We need to show filename as it may be truncated in directory listing */
|
||||||
if (!cfg.blkorder)
|
if (!cfg.blkorder)
|
||||||
snprintf(buf, NAME_MAX + 65, "%d/%d %s[%s%s]",
|
snprintf(buf, NAME_MAX + 65, "%d/%d %s[%s%s]",
|
||||||
cur + 1, ndents, sort, unescape(dents[cur].name, 0), get_file_sym(dents[cur].mode));
|
cur + 1, ndents, sort, unescape(dents[cur].name, NAME_MAX), get_file_sym(dents[cur].mode));
|
||||||
else {
|
else {
|
||||||
i = snprintf(buf, 64, "%d/%d ", cur + 1, ndents);
|
i = snprintf(buf, 64, "%d/%d ", cur + 1, ndents);
|
||||||
|
|
||||||
|
@ -2417,7 +2417,7 @@ static void redraw(char *path)
|
||||||
|
|
||||||
i += snprintf(buf + i, 64, "u: %s (%lu files) ", coolsize(dir_blocks << BLK_SHIFT), num_files);
|
i += snprintf(buf + i, 64, "u: %s (%lu files) ", coolsize(dir_blocks << BLK_SHIFT), num_files);
|
||||||
snprintf(buf + i, NAME_MAX, "vol: %s free [%s%s]",
|
snprintf(buf + i, NAME_MAX, "vol: %s free [%s%s]",
|
||||||
coolsize(get_fs_info(path, FREE)), unescape(dents[cur].name, 0), get_file_sym(dents[cur].mode));
|
coolsize(get_fs_info(path, FREE)), unescape(dents[cur].name, NAME_MAX), get_file_sym(dents[cur].mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
printmsg(buf);
|
printmsg(buf);
|
||||||
|
|
Loading…
Reference in a new issue