diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2020-07-04 23:01:36 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2020-07-04 23:01:36 +0530 |
commit | 709e7bd7ddfc9db7bb13e441b80953c9bb19dbbb (patch) | |
tree | d3d821abbcddf208aefefd85c921ec2037e74dcc /src | |
parent | 1faf9f248080ee2acc704af5e948726a2f66fe55 (diff) | |
download | nnn-709e7bd7ddfc9db7bb13e441b80953c9bb19dbbb.tar.gz |
Remove snprintf() from start-up path
Diffstat (limited to 'src')
-rw-r--r-- | src/nnn.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); } |