From 5889271114a25b6750bb6137784ae5a93df22b39 Mon Sep 17 00:00:00 2001 From: Sun He Date: Mon, 3 Mar 2014 17:24:29 +0800 Subject: finish_tmp_packfile():use strbuf for pathname construction The old version fixes a maximum length on the buffer, which could be a problem if one is not certain of the length of get_object_directory(). Using strbuf can avoid the protential bug. Helped-by: Michael Haggerty Helped-by: Eric Sunshine Signed-off-by: Sun He Signed-off-by: Junio C Hamano --- pack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pack.h') diff --git a/pack.h b/pack.h index 12d951659c..3223f5a038 100644 --- a/pack.h +++ b/pack.h @@ -91,6 +91,6 @@ extern int encode_in_pack_object_header(enum object_type, uintmax_t, unsigned ch extern int read_pack_header(int fd, struct pack_header *); extern struct sha1file *create_tmp_packfile(char **pack_tmp_name); -extern void finish_tmp_packfile(char *name_buffer, const char *pack_tmp_name, struct pack_idx_entry **written_list, uint32_t nr_written, struct pack_idx_option *pack_idx_opts, unsigned char sha1[]); +extern void finish_tmp_packfile(struct strbuf *name_buffer, const char *pack_tmp_name, struct pack_idx_entry **written_list, uint32_t nr_written, struct pack_idx_option *pack_idx_opts, unsigned char sha1[]); #endif -- cgit v1.2.1