From: sin Date: Wed, 22 Oct 2014 14:14:33 +0000 (+0100) Subject: No need for a temporary buffer X-Git-Tag: v1.0~92^2~170 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9bc4b92474ded6ff9097525646311e424a5cddc3;p=nnn.git No need for a temporary buffer xdirname() uses xstrdup() internally so we are safe to use that pointer directly. --- diff --git a/noice.c b/noice.c index 37cc91db..820b851a 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 */