Thread (1 message) 1 message, 1 author, 2016-07-27

Re: [PATCH] i18n: config: unfold error messages marked for translation

From: Junio C Hamano <hidden>
Date: 2016-07-27 22:41:15

Vasco Almeida [off-list ref] writes:
quoted hunk
+	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.
quoted hunk
 	else
-		return error(_("bad config line %d in %s %s"), cf->linenr, cf->origin_type, cf->name);
+		error_return =  error(error_msg);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help