sequencer: use argv_array_pushf
[gitweb.git] / sha1_name.c
index 2b6322fad064845f4c782286fe9764f6b958f30d..5e956904b6684bca0cca4e50c71e2d94ce1b8ba3 100644 (file)
@@ -1252,10 +1252,7 @@ static void diagnose_invalid_sha1_path(const char *prefix,
                die("Path '%s' exists on disk, but not in '%.*s'.",
                    filename, object_name_len, object_name);
        if (errno == ENOENT || errno == ENOTDIR) {
-               char *fullname = xmalloc(strlen(filename)
-                                            + strlen(prefix) + 1);
-               strcpy(fullname, prefix);
-               strcat(fullname, filename);
+               char *fullname = xstrfmt("%s%s", prefix, filename);
 
                if (!get_tree_entry(tree_sha1, fullname,
                                    sha1, &mode)) {