Skip to content

Commit aa8bd51

Browse files
peffgitster
authored andcommitted
repack: make parsed string options const-correct
When we use OPT_STRING to parse an option, we get back a pointer into the argv array, which should be "const char *". The compiler doesn't notice because it gets passed through a "void *" in the option struct. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 44b96ec commit aa8bd51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/repack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
129129
/* variables to be filled by option parsing */
130130
int pack_everything = 0;
131131
int delete_redundant = 0;
132-
char *unpack_unreachable = NULL;
132+
const char *unpack_unreachable = NULL;
133133
int window = 0, window_memory = 0;
134134
int depth = 0;
135135
int max_pack_size = 0;

0 commit comments

Comments
 (0)