summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2015-06-30 22:28:41 +0200
committerWerner Koch <wk@gnupg.org>2015-06-30 22:28:41 +0200
commit232af382e563fcbe15589a3ccae7d6908a17c44d (patch)
treedae4d92d1224900f5a15643e192fc352326cfd2b /agent
parentagent: Use different translation func for Pinentry strings. (diff)
downloadgnupg2-232af382e563fcbe15589a3ccae7d6908a17c44d.tar.xz
gnupg2-232af382e563fcbe15589a3ccae7d6908a17c44d.zip
Flag the L_() function with attribute format_arg.
* agent/agent.h (LunderscorePROTO): New. * common/util.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. * common/i18n.h (GNUPG_GCC_ATTR_FORMAT_ARG): New. Use for i18n_localegettext. Expand LunderscorePROTO. * agent/genkey.c (check_passphrase_constraints): Use xtryasprintf again to keep the old translations. -- Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'agent')
-rw-r--r--agent/agent.h4
-rw-r--r--agent/genkey.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/agent/agent.h b/agent/agent.h
index 70d63cf5d..2948bff76 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -301,6 +301,10 @@ typedef int (*lookup_ttl_t)(const char *hexgrip);
the connection. The macro LunderscoreIMPL is used by i18n to
actually define the inline function when needed. */
#define L_(a) agent_Lunderscore (ctrl, (a))
+#define LunderscorePROTO \
+ static inline const char *agent_Lunderscore (ctrl_t ctrl, \
+ const char *string) \
+ GNUPG_GCC_ATTR_FORMAT_ARG(2);
#define LunderscoreIMPL \
static inline const char * \
agent_Lunderscore (ctrl_t ctrl, const char *string) \
diff --git a/agent/genkey.c b/agent/genkey.c
index b5dee8ee5..df17880c9 100644
--- a/agent/genkey.c
+++ b/agent/genkey.c
@@ -271,8 +271,9 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw,
goto leave;
}
- msg3 = xtrystrdup (L_("A passphrase may not be a known term or match%0A"
- "certain pattern."));
+ msg3 = xtryasprintf
+ (L_("A passphrase may not be a known term or match%%0A"
+ "certain pattern."));
if (!msg3)
{
err = gpg_error_from_syserror ();