Skip to content

Commit 0039ba7

Browse files
drafnelgitster
authored andcommitted
unpack-trees.c: work around run-time array initialization flaw on IRIX 6.5
The c99 MIPSpro Compiler version 7.4.4m on IRIX 6.5 does not properly initialize run-time initialized arrays. An array which is initialized with fewer elements than the length of the array should have the unitialized elements initialized to zero. This compiler only initializes the remaining elements when the last element is a static parameter. So work around it by adding a "NULL" initialization parameter. Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 20f3749 commit 0039ba7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

unpack-trees.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static inline int call_unpack_fn(struct cache_entry **src, struct unpack_trees_o
128128

129129
static int unpack_index_entry(struct cache_entry *ce, struct unpack_trees_options *o)
130130
{
131-
struct cache_entry *src[5] = { ce, };
131+
struct cache_entry *src[5] = { ce, NULL, };
132132

133133
o->pos++;
134134
if (ce_stage(ce)) {

0 commit comments

Comments
 (0)