Skip to content

Commit

Permalink
repack: make parsed string options const-correct
Browse files Browse the repository at this point in the history
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jan 23, 2014
1 parent 44b96ec commit aa8bd51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
/* variables to be filled by option parsing */
int pack_everything = 0;
int delete_redundant = 0;
char *unpack_unreachable = NULL;
const char *unpack_unreachable = NULL;
int window = 0, window_memory = 0;
int depth = 0;
int max_pack_size = 0;
Expand Down

0 comments on commit aa8bd51

Please sign in to comment.