Skip to content

Commit

Permalink
unpack-trees.c: work around run-time array initialization flaw on IRI…
Browse files Browse the repository at this point in the history
…X 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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Jul 11, 2009
1 parent 20f3749 commit 0039ba7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unpack-trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static inline int call_unpack_fn(struct cache_entry **src, struct unpack_trees_o

static int unpack_index_entry(struct cache_entry *ce, struct unpack_trees_options *o)
{
struct cache_entry *src[5] = { ce, };
struct cache_entry *src[5] = { ce, NULL, };

o->pos++;
if (ce_stage(ce)) {
Expand Down

0 comments on commit 0039ba7

Please sign in to comment.