Skip to content

Commit

Permalink
src: change FormatSize to actually accept a size_t
Browse files Browse the repository at this point in the history
This function is only called with size_t values and it does not deal
with unsigned values nicely, so its argument type should be size_t.

PR-URL: #43464
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
  • Loading branch information
tniessen authored and targos committed Jul 12, 2022
1 parent b9204c9 commit 0659d5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_snapshotable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static std::string GetCodeCacheDefName(const std::string& id) {
return std::string(buf) + std::string("_cache_data");
}

static std::string FormatSize(int size) {
static std::string FormatSize(size_t size) {
char buf[64] = {0};
if (size < 1024) {
snprintf(buf, sizeof(buf), "%.2fB", static_cast<double>(size));
Expand Down

0 comments on commit 0659d5e

Please sign in to comment.