mirror of
https://github.com/jarun/nnn.git
synced 2025-02-26 03:01:32 +00:00
Remove snprintf() from start-up path
This commit is contained in:
parent
1faf9f2480
commit
709e7bd7dd
1 changed files with 4 additions and 1 deletions
|
@ -7287,7 +7287,10 @@ int main(int argc, char *argv[])
|
||||||
/* Create fifo */
|
/* Create fifo */
|
||||||
if (g_state.autofifo) {
|
if (g_state.autofifo) {
|
||||||
g_tmpfpath[tmpfplen - 1] = '\0';
|
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);
|
setenv("NNN_FIFO", g_buf, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue