mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
fix the malloc size in get_archive_cmd
since the tr hack was removed in deead97
, the format string is no longer
70 chars. also removes unnecessary malloc casting.
This commit is contained in:
parent
c87b67e073
commit
f7091f78e5
|
@ -2721,8 +2721,8 @@ static void get_archive_cmd(char *cmd, const char *archive)
|
||||||
|
|
||||||
static void archive_selection(const char *cmd, const char *archive, const char *curpath)
|
static void archive_selection(const char *cmd, const char *archive, const char *curpath)
|
||||||
{
|
{
|
||||||
/* The 70 comes from the string below */
|
/* The 38 comes from the format string below */
|
||||||
char *buf = (char *)malloc((70 + xstrlen(cmd) + xstrlen(archive)
|
char *buf = malloc((38 + xstrlen(cmd) + xstrlen(archive)
|
||||||
+ xstrlen(curpath) + xstrlen(selpath)) * sizeof(char));
|
+ xstrlen(curpath) + xstrlen(selpath)) * sizeof(char));
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
DPRINTF_S(strerror(errno));
|
DPRINTF_S(strerror(errno));
|
||||||
|
|
Loading…
Reference in a new issue