summaryrefslogtreecommitdiff
path: root/diff.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-03-10 11:13:43 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-03-10 11:13:43 -0800
commitb7a6ec609ff10652541e7f716fcecf7865b94b23 (patch)
tree92c449ecb681311c3713a1d2be178776b05bd259 /diff.h
parentMerge branch 'jk/more-comments-on-textconv' into maint (diff)
parentcompat/mingw: brown paper bag fix for 50a6c8e (diff)
downloadtgif-b7a6ec609ff10652541e7f716fcecf7865b94b23.tar.xz
Merge branch 'jk/tighten-alloc' into maint
* jk/tighten-alloc: (23 commits) compat/mingw: brown paper bag fix for 50a6c8e ewah: convert to REALLOC_ARRAY, etc convert ewah/bitmap code to use xmalloc diff_populate_gitlink: use a strbuf transport_anonymize_url: use xstrfmt git-compat-util: drop mempcpy compat code sequencer: simplify memory allocation of get_message test-path-utils: fix normalize_path_copy output buffer size fetch-pack: simplify add_sought_entry fast-import: simplify allocation in start_packfile write_untracked_extension: use FLEX_ALLOC helper prepare_{git,shell}_cmd: use argv_array use st_add and st_mult for allocation size computation convert trivial cases to FLEX_ARRAY macros use xmallocz to avoid size arithmetic convert trivial cases to ALLOC_ARRAY convert manual allocations to argv_array argv-array: add detach function add helpers for allocating flex-array structs harden REALLOC_ARRAY and xcalloc against size_t overflow ...
Diffstat (limited to 'diff.h')
-rw-r--r--diff.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff.h b/diff.h
index 4505b4d91d..e7d68edaf9 100644
--- a/diff.h
+++ b/diff.h
@@ -222,8 +222,8 @@ struct combine_diff_path {
} parent[FLEX_ARRAY];
};
#define combine_diff_path_size(n, l) \
- (sizeof(struct combine_diff_path) + \
- sizeof(struct combine_diff_parent) * (n) + (l) + 1)
+ st_add4(sizeof(struct combine_diff_path), (l), 1, \
+ st_mult(sizeof(struct combine_diff_parent), (n)))
extern void show_combined_diff(struct combine_diff_path *elem, int num_parent,
int dense, struct rev_info *);