fix: remove _s poison

This commit is contained in:
2025-02-06 12:34:59 +01:00
parent 27d5985574
commit a299874dd2
16 changed files with 101 additions and 100 deletions
+7 -16
View File
@@ -3,12 +3,10 @@
#include "game/game.hpp"
#include "game/dvars.hpp"
#include "scheduler.hpp"
#include "scripting.hpp"
#include "console.hpp"
#include "game_log.hpp"
#include "gsc/script_extension.hpp"
#include "scheduler.hpp"
#include "scripting.hpp"
#include <utils/hook.hpp>
#include <utils/io.hpp>
@@ -23,7 +21,7 @@ namespace game_log
char buf[1024]{};
std::size_t out_chars = 0;
for (auto i = 0u; i < game::Scr_GetNumParam(); ++i)
for (std::uint32_t i = 0; i < game::Scr_GetNumParam(); ++i)
{
const auto* value = game::Scr_GetString(i);
const auto len = std::strlen(value);
@@ -34,7 +32,7 @@ namespace game_log
break;
}
strncat_s(buf, value, _TRUNCATE);
game::I_strncat(buf, sizeof(buf), value);
}
g_log_printf("%s", buf);
@@ -49,22 +47,15 @@ namespace game_log
return;
}
char buffer[0x400]{};
char buffer[1024]{};
va_list ap;
va_start(ap, fmt);
vsprintf_s(buffer, fmt, ap);
vsnprintf(buffer, sizeof(buffer), fmt, ap);
va_end(ap);
const auto time = *game::level_time / 1000;
utils::io::write_file(log, utils::string::va("%3i:%i%i %s",
time / 60,
time % 60 / 10,
time % 60 % 10,
buffer
), true);
utils::io::write_file(log, utils::string::va("%3i:%i%i %s", time / 60, time % 60 / 10, time % 60 % 10, buffer), true);
}
class component final : public component_interface