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: nodejs#43464
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
tniessen authored and F3n67u committed Jun 24, 2022
1 parent 00e23ac commit 4463b36
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 4463b36

Please sign in to comment.