git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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);
Previous: Vasco AlmeidaNext: Vasco Almeida
Message 4 of 7 in “i18n: config: unfold error messages marked for translation”
  1. i18n: config: unfold error messages marked for translationVasco Almeida, Jul 27, 2016
  2. Junio C HamanoJul 27, 2016
  3. Vasco AlmeidaJul 28, 2016
  4. Junio C HamanoJul 27, 2016
  5. i18n: config: unfold error messages marked for translationVasco Almeida, Jul 28, 2016
  6. Junio C HamanoJul 28, 2016
  7. Jeff KingJul 28, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.