Skip to content

Commit 54fd955

Browse files
jlehmanngitster
authored andcommitted
Let check_preimage() use memset() to initialize "struct checkout"
Every code site except check_preimage() uses either memset() or declares a static instance of "struct checkout" to achieve proper initialization. Lets use memset() instead of explicit initialization of all members here too to be on the safe side in case this structure is expanded someday. Signed-off-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 408dee5 commit 54fd955

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

builtin-apply.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,11 +2824,8 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s
28242824
if (stat_ret < 0) {
28252825
struct checkout costate;
28262826
/* checkout */
2827+
memset(&costate, 0, sizeof(costate));
28272828
costate.base_dir = "";
2828-
costate.base_dir_len = 0;
2829-
costate.force = 0;
2830-
costate.quiet = 0;
2831-
costate.not_new = 0;
28322829
costate.refresh_cache = 1;
28332830
if (checkout_entry(*ce, &costate, NULL) ||
28342831
lstat(old_name, st))

0 commit comments

Comments
 (0)