From 04e2c83f189cc56342e1be784bdc63761ccdb5bb Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 22 Aug 2013 09:35:21 +0200 Subject: [PATCH] agent: Fix two compiler warnings. * agent/command.c (cmd_preset_passphrase, pinentry_loopback): Use %zu in format string. * scd/ccid-driver.c (ccid_get_atr): Ditto. * agent/command-ssh.c (stream_read_string): Init arg STRING_SIZE to avoid maybe_unitialized warning. -- Actually the first one might have been a problem on big endian machines. Signed-off-by: Werner Koch --- agent/command-ssh.c | 2 ++ agent/command.c | 4 ++-- scd/ccid-driver.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/agent/command-ssh.c b/agent/command-ssh.c index f378ade55..0ff70b534 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -487,6 +487,8 @@ stream_read_string (estream_t stream, unsigned int secure, unsigned char *buffer = NULL; u32 length = 0; + *string_size = 0; + /* Read string length. */ err = stream_read_uint32 (stream, &length); if (err) diff --git a/agent/command.c b/agent/command.c index 5e955ab6d..8e5d1803a 100644 --- a/agent/command.c +++ b/agent/command.c @@ -1809,7 +1809,7 @@ cmd_preset_passphrase (assuan_context_t ctx, char *line) * limit is 480 characters. */ size_t maxlen = 480; - rc = print_assuan_status (ctx, "INQUIRE_MAXLEN", "%u", maxlen); + rc = print_assuan_status (ctx, "INQUIRE_MAXLEN", "%zu", maxlen); if (!rc) rc = assuan_inquire (ctx, "PASSPHRASE", &passphrase, &len, maxlen); } @@ -3038,7 +3038,7 @@ pinentry_loopback(ctrl_t ctrl, const char *keyword, gpg_error_t rc; assuan_context_t ctx = ctrl->server_local->assuan_ctx; - rc = print_assuan_status (ctx, "INQUIRE_MAXLEN", "%u", max_length); + rc = print_assuan_status (ctx, "INQUIRE_MAXLEN", "%zu", max_length); if (rc) return rc; diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c index 3376be0e9..478d8c6c0 100644 --- a/scd/ccid-driver.c +++ b/scd/ccid-driver.c @@ -2673,7 +2673,7 @@ ccid_get_atr (ccid_driver_t handle, if (msglen != 10 + 4) { - DEBUGOUT_1 ("Setting PPS failed: %d\n", msglen); + DEBUGOUT_1 ("Setting PPS failed: %zu\n", msglen); return CCID_DRIVER_ERR_CARD_IO_ERROR; }