From 67a4c5e0db36afe47967ddbf6c600b34ee8bdaca Mon Sep 17 00:00:00 2001 From: glx22 Date: Thu, 9 Feb 2023 19:28:50 +0100 Subject: [PATCH] Codechange: Use {fmt} for script_admin JSON generation --- src/script/api/script_admin.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/script/api/script_admin.cpp b/src/script/api/script_admin.cpp index 24aa0bcaf3..42615d2aed 100644 --- a/src/script/api/script_admin.cpp +++ b/src/script/api/script_admin.cpp @@ -28,9 +28,7 @@ SQInteger res; sq_getinteger(vm, index, &res); - char buf[10]; - seprintf(buf, lastof(buf), "%d", (int32)res); - data = buf; + data = fmt::format("{}", res); return true; } @@ -44,7 +42,7 @@ return false; } - data = std::string("\"") + buf + "\""; + data = fmt::format("\"{}\"", buf); return true; }