From 4463b3688bef61b465bf71d24b2ea537369240cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 20 Jun 2022 09:50:55 +0200 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. PR-URL: https://github.com/nodejs/node/pull/43464 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen --- 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 2bc30b20bcdeac0..b71c46acabed72b 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));