Re: [PATCH] i18n: config: unfold error messages marked for translation
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 27, 2016, 22:41 UTC
- Message-ID
- <xmqqvazqu2ke.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <1469642375-27305-1-git-send-email-vascomalmeida@sapo.pt>
Vasco Almeida <vascomalmeida@sapo.pt> writes:
Show 8 quoted lines
> + default:
> + error_msg = xstrfmt(_("bad config line %d in %s"),
> + cf->linenr, cf->name);
> + }
> +
> if (cf->die_on_error)
> - die(_("bad config line %d in %s %s"), cf->linenr, cf->origin_type, cf->name);
> + die(error_msg);As error_msg is a result of xstrfmt() and there is no further interpolation needed, you would want to say
die("%s", error_msg);here. It triggers
config.c:541:3: error: format not a string literal and no format arguments [-Werror=format-security]
Similarly for error() below.
> else
> - return error(_("bad config line %d in %s %s"), cf->linenr, cf->origin_type, cf->name);
> + error_return = error(error_msg);