aboutsummaryrefslogtreecommitdiffstats
path: root/noice.c
diff options
context:
space:
mode:
authorGravatar sin <sin@2f30.org>2014-10-22 15:14:33 +0100
committerGravatar sin <sin@2f30.org>2014-10-22 15:14:33 +0100
commit9bc4b92474ded6ff9097525646311e424a5cddc3 (patch)
tree9865dc73d87fc4837ff156406280329b22d25971 /noice.c
parent35f3b250bb1e218a46da9e6287f31fb5aeaa3f62 (diff)
downloadnnn-9bc4b92474ded6ff9097525646311e424a5cddc3.tar.gz
No need for a temporary buffer
xdirname() uses xstrdup() internally so we are safe to use that pointer directly.
Diffstat (limited to 'noice.c')
-rw-r--r--noice.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/noice.c b/noice.c
index 37cc91d..820b851 100644
--- a/noice.c
+++ b/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 */