diff options
author | NIIBE Yutaka <[email protected]> | 2016-10-21 03:04:46 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2016-10-21 03:04:46 +0000 |
commit | 6e85ac77af594035137950d801d8a1bacce548a3 (patch) | |
tree | 9886172b88af046b48da1a4be262adc70ded234e /sm/call-dirmngr.c | |
parent | agent: Fix saving with FORCE=1. (diff) | |
download | gnupg-6e85ac77af594035137950d801d8a1bacce548a3.tar.gz gnupg-6e85ac77af594035137950d801d8a1bacce548a3.zip |
Fix use cases of snprintf.
* agent/call-pinentry.c, agent/call-scd.c, agent/command.c,
build-aux/speedo/w32/g4wihelp.c, common/get-passphrase.c,
dirmngr/dirmngr.c, g10/call-agent.c, g10/cpr.c, g10/keygen.c,
g10/openfile.c, g10/passphrase.c, scd/app-openpgp.c, scd/scdaemon.c,
sm/call-agent.c, sm/call-dirmngr.c, sm/certreqgen.c: Fix assuming C99.
--
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'sm/call-dirmngr.c')
-rw-r--r-- | sm/call-dirmngr.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sm/call-dirmngr.c b/sm/call-dirmngr.c index f561bb08c..03c9a6833 100644 --- a/sm/call-dirmngr.c +++ b/sm/call-dirmngr.c @@ -215,9 +215,8 @@ prepare_dirmngr (ctrl_t ctrl, assuan_context_t ctx, gpg_error_t err) char *pass = server->pass ? server->pass : ""; char *base = server->base ? server->base : ""; - snprintf (line, DIM (line) - 1, "LDAPSERVER %s:%i:%s:%s:%s", + snprintf (line, DIM (line), "LDAPSERVER %s:%i:%s:%s:%s", server->host, server->port, user, pass, base); - line[DIM (line) - 1] = 0; assuan_transact (ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); /* The code below is not required because we don't return an error. */ @@ -548,10 +547,9 @@ gpgsm_dirmngr_isvalid (ctrl_t ctrl, NULL, NULL, NULL, NULL, NULL, NULL); did_options = 1; } - snprintf (line, DIM(line)-1, "ISVALID%s %s", + snprintf (line, DIM(line), "ISVALID%s %s", use_ocsp == 2? " --only-ocsp --force-default-responder":"", certid); - line[DIM(line)-1] = 0; xfree (certid); rc = assuan_transact (dirmngr_ctx, line, NULL, NULL, @@ -803,9 +801,8 @@ gpgsm_dirmngr_lookup (ctrl_t ctrl, strlist_t names, int cache_only, return out_of_core (); } - snprintf (line, DIM(line)-1, "LOOKUP%s %s", + snprintf (line, DIM(line), "LOOKUP%s %s", cache_only? " --cache-only":"", pattern); - line[DIM(line)-1] = 0; xfree (pattern); parm.ctrl = ctrl; @@ -861,7 +858,7 @@ get_cached_cert (assuan_context_t ctx, *r_cert = NULL; bin2hex (fpr, 20, hexfpr); - snprintf (line, DIM(line)-1, "LOOKUP --single --cache-only 0x%s", hexfpr); + snprintf (line, DIM(line), "LOOKUP --single --cache-only 0x%s", hexfpr); init_membuf (&mb, 4096); err = assuan_transact (ctx, line, get_cached_cert_data_cb, &mb, |