1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

gpg: Replace use of PRIu64 in log_debug

* g10/cipher-aead.c (do_flush): Use %llu and a cast.
* g10/decrypt-data.c (aead_underflow): Ditto.
--

Fixes-commit: b2cedc108d5cabb07f496c31c11c9cba6f328f76

We don't use the system's printf but the one implemented by
us (gpgrt's estream-printf) thus the PRIu64 may or may not be correct.
We can't do much about the -Wformat errors due to our different
implementation.
This commit is contained in:
Werner Koch 2022-12-16 15:33:46 +01:00
parent 329dd3fa8c
commit f297803a67
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 10 additions and 8 deletions

View File

@ -295,9 +295,9 @@ 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 %"PRIu64" reached;"
log_debug ("chunksize %llu reached;"
" cur buflen=%zu using %zu of %zu\n",
cfx->chunksize, cfx->buflen,
(unsigned long long)cfx->chunksize, cfx->buflen,
n1, n);
n = n1;
}

View File

@ -675,8 +675,10 @@ 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=%"PRIu64" total=%"PRIu64" size=%zu len=%zu%s\n",
dfx->chunklen, dfx->total, size, len,
log_debug ("decrypt: chunklen=%llu total=%llu size=%zu len=%zu%s\n",
(unsigned long long)dfx->chunklen,
(unsigned long long)dfx->total,
size, len,
dfx->eof_seen? " eof":"");
while (len && dfx->chunklen + len >= dfx->chunksize)
@ -712,8 +714,8 @@ 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=%"PRIu64") bytes left: %zu at off=%zu\n",
totallen, dfx->chunklen, len, off);
log_debug ("ndecrypted: %zu (nchunk=%llu) bytes left: %zu at off=%zu\n",
totallen, (unsigned long long)dfx->chunklen, len, off);
/* Check the tag. */
if (len < 16)
@ -794,8 +796,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=%"PRIu64")\n",
totallen, dfx->chunklen);
log_debug ("ndecrypted: %zu (nchunk=%llu)\n",
totallen, (unsigned long long)dfx->chunklen);
}
if (dfx->eof_seen)