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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2013-08-22 09:35:21 +02:00
parent b6d54f1196
commit 04e2c83f18
3 changed files with 5 additions and 3 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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;
}