]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Use scalloc to get a null-terminated string
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 24 Jul 2010 10:32:03 +0000 (12:32 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 24 Jul 2010 10:32:03 +0000 (12:32 +0200)
src/config.c

index fa4a60421288de011d2ddb60328064ed1cffb307..6d5f57f1f90a0f4ab0499a0b47afef85578c0455 100644 (file)
@@ -59,7 +59,7 @@ char *resolve_tilde(const char *path) {
         }
         else {
                 head = globbuf.gl_pathv[0];
-                result = smalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1);
+                result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1);
                 strncpy(result, head, strlen(head));
                 strncat(result, tail, strlen(tail));
         }