From 9bc4b92474ded6ff9097525646311e424a5cddc3 Mon Sep 17 00:00:00 2001
From: sin <sin@2f30.org>
Date: Wed, 22 Oct 2014 15:14:33 +0100
Subject: [PATCH] No need for a temporary buffer

xdirname() uses xstrdup() internally so we are safe to use that
pointer directly.
---
 noice.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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 */
-- 
2.51.0