From b2cedc108d5cabb07f496c31c11c9cba6f328f76 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 2 Feb 2022 11:09:48 +0900 Subject: [PATCH] gpg: Fix for -Wformat when using uint64_t. * g10/cipher-aead.c (do_flush): Use PRIu64. * g10/decrypt-data.c (aead_underflow): Likewise. -- Even among LP64 data model machines, uint64_t type may differ; unsigned long or unsigned long long. Only portable way is use of PRIu64. Signed-off-by: NIIBE Yutaka --- g10/cipher-aead.c | 2 +- g10/decrypt-data.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/g10/cipher-aead.c b/g10/cipher-aead.c index b14b85444..1fd2021e5 100644 --- a/g10/cipher-aead.c +++ b/g10/cipher-aead.c @@ -276,7 +276,7 @@ do_flush (cipher_filter_context_t *cfx, iobuf_t a, byte *buf, size_t size) size_t n1 = cfx->chunksize - (cfx->chunklen + cfx->buflen); finalize = 1; if (DBG_FILTER) - log_debug ("chunksize %ju reached;" + log_debug ("chunksize %"PRIu64" reached;" " cur buflen=%zu using %zu of %zu\n", cfx->chunksize, cfx->buflen, n1, n); diff --git a/g10/decrypt-data.c b/g10/decrypt-data.c index 345447db1..8140de6dd 100644 --- a/g10/decrypt-data.c +++ b/g10/decrypt-data.c @@ -662,7 +662,7 @@ aead_underflow (decode_filter_ctx_t dfx, iobuf_t a, byte *buf, size_t *ret_len) /* Decrypt the buffer. This first requires a loop to handle the * case when a chunk ends within the buffer. */ if (DBG_FILTER) - log_debug ("decrypt: chunklen=%ju total=%ju size=%zu len=%zu%s\n", + log_debug ("decrypt: chunklen=%"PRIu64" total=%"PRIu64" size=%zu len=%zu%s\n", dfx->chunklen, dfx->total, size, len, dfx->eof_seen? " eof":""); @@ -699,7 +699,7 @@ aead_underflow (decode_filter_ctx_t dfx, iobuf_t a, byte *buf, size_t *ret_len) len -= n; if (DBG_FILTER) - log_debug ("ndecrypted: %zu (nchunk=%ju) bytes left: %zu at off=%zu\n", + log_debug ("ndecrypted: %zu (nchunk=%"PRIu64") bytes left: %zu at off=%zu\n", totallen, dfx->chunklen, len, off); /* Check the tag. */ @@ -781,7 +781,8 @@ aead_underflow (decode_filter_ctx_t dfx, iobuf_t a, byte *buf, size_t *ret_len) dfx->chunklen += len; dfx->total += len; if (DBG_FILTER) - log_debug ("ndecrypted: %zu (nchunk=%ju)\n", totallen, dfx->chunklen); + log_debug ("ndecrypted: %zu (nchunk=%"PRIu64")\n", + totallen, dfx->chunklen); } if (dfx->eof_seen)