Skip to content

Commit 3826902

Browse files
mhaggergitster
authored andcommitted
find_first_merges(): initialize merges variable using initializer
Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16aa3bf commit 3826902

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

submodule.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ static int find_first_merges(struct object_array *result, const char *path,
846846
struct commit *a, struct commit *b)
847847
{
848848
int i, j;
849-
struct object_array merges;
849+
struct object_array merges = OBJECT_ARRAY_INIT;
850850
struct commit *commit;
851851
int contains_another;
852852

@@ -856,7 +856,6 @@ static int find_first_merges(struct object_array *result, const char *path,
856856
struct rev_info revs;
857857
struct setup_revision_opt rev_opts;
858858

859-
memset(&merges, 0, sizeof(merges));
860859
memset(result, 0, sizeof(struct object_array));
861860
memset(&rev_opts, 0, sizeof(rev_opts));
862861

0 commit comments

Comments
 (0)