瀏覽代碼

Fix #301 - use local buffer to avoid overwriting g_buf

master
Arun Prakash Jana 6 年之前
父節點
當前提交
8fe4761092
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: A75979F35C080412
共有 1 個檔案被更改,包括 4 行新增2 行删除
  1. +4
    -2
      src/nnn.c

+ 4
- 2
src/nnn.c 查看文件

@@ -1265,14 +1265,16 @@ finish:


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)
{ {
snprintf(g_buf, CMD_LEN_MAX,
char *buf = (char *)malloc(CMD_LEN_MAX * sizeof(char));
snprintf(buf, CMD_LEN_MAX,
#ifdef __linux__ #ifdef __linux__
"xargs -0 -a %s %s %s", "xargs -0 -a %s %s %s",
#else #else
"cat %s | xargs -0 -o %s %s", "cat %s | xargs -0 -o %s %s",
#endif #endif
g_cppath, cmd, archive); 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) static bool write_lastdir(const char *curpath)


Loading…
取消
儲存