1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* card-util.c (print_name): Fixed bad format string usage.

(print_isoname): Ditto.

* trustdb.c (check_regexp): s/exp/expr/.

* keyedit.c (trustsig_prompt): Removed a "> 255" term; it is
always false due to the data type.

* passphrase.c (agent_get_passphrase): Use xasprintf and avoid
non-literal format strings.

* tdbio.c (upd_hashtable, drop_from_hashtable, lookup_hashtable):
Fixed log_error format string bugs.  Kudos to the now working
gcc-3.3 -Wformat-nonliteral and Florian Weimer's investigations in
gnupg 1.2.3.
This commit is contained in:
Werner Koch 2003-12-17 12:26:56 +00:00
parent 8ab35a7d26
commit 23fa5c9792
6 changed files with 49 additions and 35 deletions

View file

@ -673,32 +673,26 @@ agent_get_passphrase ( u32 *keyid, int mode, const char *tryagain_text,
const char *algo_name = gcry_pk_algo_name ( pk->pubkey_algo );
const char *timestr;
char *maink;
const char *fmtstr;
if ( !algo_name )
algo_name = "?";
fmtstr = _(" (main key ID %08lX)");
maink = xmalloc ( strlen (fmtstr) + 20 );
if( keyid[2] && keyid[3] && keyid[0] != keyid[2]
&& keyid[1] != keyid[3] )
sprintf( maink, fmtstr, (ulong)keyid[3] );
maink = xasprintf ( _(" (main key ID %08lX)"), (ulong)keyid[3] );
else
*maink = 0;
maink = NULL;
uid = get_user_id ( keyid, &uidlen );
timestr = strtimestamp (pk->timestamp);
fmtstr = _("You need a passphrase to unlock the"
atext = xasprintf (
_("You need a passphrase to unlock the"
" secret key for user:\n"
"\"%.*s\"\n"
"%u-bit %s key, ID %08lX, created %s%s\n" );
atext = xmalloc ( 100 + strlen (fmtstr)
+ uidlen + 15 + strlen(algo_name) + 8
+ strlen (timestr) + strlen (maink) );
sprintf (atext, fmtstr,
"%u-bit %s key, ID %08lX, created %s%s\n" ),
uidlen, uid,
nbits_from_pk (pk), algo_name, (ulong)keyid[1], timestr,
maink );
maink?maink:"" );
xfree (uid);
xfree (maink);