From 2135e0a5738aec3a263ee88fa3bccfd33f8727a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sat, 18 Jun 2022 00:20:07 +0000 Subject: [PATCH] src: change FormatSize to actually accept a size_t 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. --- src/node_snapshotable.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_snapshotable.cc b/src/node_snapshotable.cc index 2bc30b20bcdeac..b71c46acabed72 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -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(size));