There was a warning that a long long could generate a string 21 bytes
long if it was maxed out. This can't actually happen, because we're
counting up. However, there's no need to use an int64_t, int32_t is
fine.
Fixes: https://tracker.ceph.com/issues/65471
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
int POSIXObject::generate_mp_etag(const DoutPrefixProvider* dpp, optional_yield y)
{
- int64_t count = 0;
+ int32_t count = 0;
char etag_buf[CEPH_CRYPTO_MD5_DIGESTSIZE];
char final_etag_str[CEPH_CRYPTO_MD5_DIGESTSIZE * 2 + 16];
std::string etag;
buf_to_hex((unsigned char *)etag_buf, sizeof(etag_buf), final_etag_str);
snprintf(&final_etag_str[CEPH_CRYPTO_MD5_DIGESTSIZE * 2],
sizeof(final_etag_str) - CEPH_CRYPTO_MD5_DIGESTSIZE * 2,
- "-%lld", (long long)count);
+ "-%" PRId32, count);
etag = final_etag_str;
ldpp_dout(dpp, 10) << "calculated etag: " << etag << dendl;