]> git.sur5r.net Git - i3/i3/blobdiff - libi3/resolve_tilde.c
Merge branch 'release-4.16'
[i3/i3] / libi3 / resolve_tilde.c
index 7a4fb79bf3c2ddca62b9b9bf07a532f96c867f58..6dbf132fa7605d59e3c7f96c4ce7ae2c57e0e51f 100644 (file)
@@ -5,8 +5,8 @@
  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
-
 #include "libi3.h"
+
 #include <err.h>
 #include <glob.h>
 #include <stdlib.h>
@@ -35,9 +35,10 @@ char *resolve_tilde(const char *path) {
     } else {
         head = globbuf.gl_pathv[0];
         result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1, 1);
-        strncpy(result, head, strlen(head));
-        if (tail)
-            strncat(result, tail, strlen(tail));
+        strcpy(result, head);
+        if (tail) {
+            strcat(result, tail);
+        }
     }
     globfree(&globbuf);