X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pack-write.c;h=ca9e63be18f9333bf0f603ddb9ddd923588be0aa;hb=69204d0ab18d28d07ee2c8c9b50bbf5bd80343ab;hp=de2bd01414f07cb2d3fb9d212895ad0f1ea1ba26;hpb=f0ede8435ab161b3aba3e5e306239d6bd74dd9b8;p=git.git diff --git a/pack-write.c b/pack-write.c index de2bd0141..ca9e63be1 100644 --- a/pack-write.c +++ b/pack-write.c @@ -73,9 +73,9 @@ const char *write_idx_file(const char *index_name, struct pack_idx_entry **objec f = sha1fd_check(index_name); } else { if (!index_name) { - static char tmpfile[PATH_MAX]; - fd = odb_mkstemp(tmpfile, sizeof(tmpfile), "pack/tmp_idx_XXXXXX"); - index_name = xstrdup(tmpfile); + static char tmp_file[PATH_MAX]; + fd = odb_mkstemp(tmp_file, sizeof(tmp_file), "pack/tmp_idx_XXXXXX"); + index_name = xstrdup(tmp_file); } else { unlink(index_name); fd = open(index_name, O_CREAT|O_EXCL|O_WRONLY, 0600);