Re: [PATCH] builtin/config.c: compilation fix
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 9, 2013, 06:31 UTC
- Message-ID
- <CAPc5daVoNef=EVxt+HAnVP9vSuQdTVHC=CRyc7_tqygxoiZeng@mail.gmail.com>
- In-Reply-To
- <866829AC-DD63-462B-B12F-BF868D0ED5C0@gmail.com>
On Thu, Aug 8, 2013 at 10:38 PM, Kyle J. McKay <mackyle@gmail.com> wrote:
>> + const char usage[] = "test-urlmatch-normalization [-p | -l] <url1>
Show 17 quoted lines
> Looks good to me except that there seems to be a missing part of the patch.
> Did you also mean to include:
>
> diff --git a/test-urlmatch-normalization.c b/test-urlmatch-normalization.c
> index 2603899b..39017c20 100644
> --- a/test-urlmatch-normalization.c
> +++ b/test-urlmatch-normalization.c
> @@ -42,7 +42,7 @@ int main(int argc, char **argv)
> }
>
> if (opt_p || opt_l)
> - die(usage);
> + die("%s", usage);
>
> That's not terribly important here since we know the string will never
> contain any '%' characters, but the comment on the patch led me to believe
> that test-urlmatch-normalization would also get the die() change.It appears that "const char usage[] = ..." is enough to convince Gcc that usage _is_ a constant and can never contain anything funky. But I agree that the usage string could be updated, and I agree that it is prudent to do the same die("%s", ...) there.