mirror of
https://github.com/jarun/nnn.git
synced 2025-03-26 00:04:11 +00:00
No need for a temporary buffer
xdirname() uses xstrdup() internally so we are safe to use that pointer directly.
This commit is contained in:
parent
35f3b250bb
commit
9bc4b92474
1 changed files with 1 additions and 3 deletions
4
noice.c
4
noice.c
|
@ -551,10 +551,8 @@ nochange:
|
|||
goto nochange;
|
||||
} else {
|
||||
dir = xdirname(path);
|
||||
tmp = xmalloc(strlen(dir) + 1);
|
||||
strlcpy(tmp, dir, strlen(dir) + 1);
|
||||
free(path);
|
||||
path = tmp;
|
||||
path = dir;
|
||||
free(filter);
|
||||
filter = xstrdup(ifilter); /* Reset filter */
|
||||
/* Recall history */
|
||||
|
|
Loading…
Add table
Reference in a new issue