From f93d7c6fa0548e95ca2795d900671a87c1a88ea3 Mon Sep 17 00:00:00 2001 From: Tanay Abhra Date: Fri, 18 Jul 2014 02:19:00 -0700 Subject: replace memset with string-list initializers Using memset and then manually setting values of the string-list members is not future proof as the internal representation of string-list may change any time. Use `string_list_init()` or STRING_LIST_INIT_* macros instead of memset. Signed-off-by: Tanay Abhra Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- transport.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'transport.c') diff --git a/transport.c b/transport.c index 59c9727d8d..d32aaf201c 100644 --- a/transport.c +++ b/transport.c @@ -1188,10 +1188,8 @@ int transport_push(struct transport *transport, if ((flags & (TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND | TRANSPORT_RECURSE_SUBMODULES_CHECK)) && !is_bare_repository()) { struct ref *ref = remote_refs; - struct string_list needs_pushing; + struct string_list needs_pushing = STRING_LIST_INIT_DUP; - memset(&needs_pushing, 0, sizeof(struct string_list)); - needs_pushing.strdup_strings = 1; for (; ref; ref = ref->next) if (!is_null_sha1(ref->new_sha1) && find_unpushed_submodules(ref->new_sha1, -- cgit v1.2.3