Skip to content

Commit

Permalink
Use %zu for size_t variables in (some) format strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ellert authored and amadio committed Jan 28, 2025
1 parent 5f973e7 commit 4169a0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/XrdMacaroons/XrdMacaroonsHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ Handler::GenerateMacaroonResponse(XrdHttpExtReq &req, const std::string &resourc
std::vector<char> macaroon_resp; macaroon_resp.resize(size_hint);
if (macaroon_serialize(mac_with_date, &macaroon_resp[0], size_hint, &mac_err))
{
printf("Returned macaroon_serialize code: %lu\n", (unsigned long)size_hint);
printf("Returned macaroon_serialize code: %zu\n", size_hint);
return req.SendSimpleResp(500, NULL, NULL, "Internal error serializing macaroon", 0);
}
macaroon_destroy(mac_with_date);
Expand Down
4 changes: 2 additions & 2 deletions src/XrdPfc/XrdPfc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,12 @@ void Cache::dec_ref_cnt(File* f, bool high_debug)
char buf[4096];
int len = snprintf(buf, 4096, "{\"event\":\"file_close\","
"\"lfn\":\"%s\",\"size\":%lld,\"blk_size\":%d,\"n_blks\":%d,\"n_blks_done\":%d,"
"\"access_cnt\":%lu,\"attach_t\":%lld,\"detach_t\":%lld,\"remotes\":%s,"
"\"access_cnt\":%zu,\"attach_t\":%lld,\"detach_t\":%lld,\"remotes\":%s,"
"\"b_hit\":%lld,\"b_miss\":%lld,\"b_bypass\":%lld,"
"\"b_todisk\":%lld,\"b_prefetch\":%lld,\"n_cks_errs\":%d}",
f->GetLocalPath().c_str(), f->GetFileSize(), f->GetBlockSize(),
f->GetNBlocks(), f->GetNDownloadedBlocks(),
(unsigned long) f->GetAccessCnt(), (long long) as->AttachTime, (long long) as->DetachTime,
f->GetAccessCnt(), (long long) as->AttachTime, (long long) as->DetachTime,
f->GetRemoteLocations().c_str(),
as->BytesHit, as->BytesMissed, as->BytesBypassed,
st.m_BytesWritten, f->GetPrefetchedBytes(), st.m_NCksumErrors
Expand Down

0 comments on commit 4169a0a

Please sign in to comment.