contrib/examples/git-revert.sh: use the $( ... ) construct for command substitution
[gitweb.git] / builtin / unpack-file.c
index 608590ada8105a2e6a8cb9d6176696b511b410f6..6fc6bcdf7f014a52703fcd44677a705c824bc0b0 100644 (file)
@@ -1,6 +1,4 @@
-#include "cache.h"
-#include "blob.h"
-#include "exec_cmd.h"
+#include "builtin.h"
 
 static char *create_temp_file(unsigned char *sha1)
 {
@@ -14,7 +12,7 @@ static char *create_temp_file(unsigned char *sha1)
        if (!buf || type != OBJ_BLOB)
                die("unable to read blob object %s", sha1_to_hex(sha1));
 
-       strcpy(path, ".merge_file_XXXXXX");
+       xsnprintf(path, sizeof(path), ".merge_file_XXXXXX");
        fd = xmkstemp(path);
        if (write_in_full(fd, buf, size) != size)
                die_errno("unable to write temp-file");