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 --- builtin/commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'builtin/commit.c') diff --git a/builtin/commit.c b/builtin/commit.c index 461c3b1cad..023df406f8 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -423,8 +423,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, die(_("cannot do a partial commit during a cherry-pick.")); } - memset(&partial, 0, sizeof(partial)); - partial.strdup_strings = 1; + string_list_init(&partial, 1); if (list_paths(&partial, !current_head ? NULL : "HEAD", prefix, &pathspec)) exit(1); -- cgit v1.2.1