From: Arun Prakash Jana Date: Sat, 4 Jul 2020 17:31:36 +0000 (+0530) Subject: Remove snprintf() from start-up path X-Git-Tag: v3.3~9 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=709e7bd7ddfc9db7bb13e441b80953c9bb19dbbb;p=nnn.git Remove snprintf() from start-up path --- diff --git a/src/nnn.c b/src/nnn.c index 2f16f5b9..2d9b2c98 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -7287,7 +7287,10 @@ int main(int argc, char *argv[]) /* Create fifo */ if (g_state.autofifo) { g_tmpfpath[tmpfplen - 1] = '\0'; - snprintf(g_buf, CMD_LEN_MAX, "%s/nnn-fifo.%d", g_tmpfpath, getpid()); + + size_t r = mkpath(g_tmpfpath, "nnn-fifo.", g_buf); + + xstrsncpy(g_buf + r - 1, xitoa(getpid()), PATH_MAX - r); setenv("NNN_FIFO", g_buf, TRUE); }