aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 2142dfc..6f6f588 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1265,14 +1265,16 @@ finish:
static void archive_selection(const char *cmd, const char *archive, const char *curpath)
{
- snprintf(g_buf, CMD_LEN_MAX,
+ char *buf = (char *)malloc(CMD_LEN_MAX * sizeof(char));
+ snprintf(buf, CMD_LEN_MAX,
#ifdef __linux__
"xargs -0 -a %s %s %s",
#else
"cat %s | xargs -0 -o %s %s",
#endif
g_cppath, cmd, archive);
- spawn("sh", "-c", g_buf, curpath, F_NORMAL);
+ spawn("sh", "-c", buf, curpath, F_NORMAL);
+ free(buf);
}
static bool write_lastdir(const char *curpath)