X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pack-write.c;h=ca9e63be18f9333bf0f603ddb9ddd923588be0aa;hb=471dcfdbb23ad423168d928335bc36217f9e311d;hp=de2bd01414f07cb2d3fb9d212895ad0f1ea1ba26;hpb=6fee20df5c0f233415790cae4accf386fee67923;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);