mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[Fix] (MG_Impl, MG_State, MG_Backend, MG_Util): Do source audit by Codex.
This commit is contained in:
@@ -95,11 +95,13 @@ namespace MobileGL {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
int n = std::vsnprintf(buffer, sizeof(buffer), fmt, args);
|
||||
const SizeT messageLength =
|
||||
(n < 0) ? 0 : std::min(static_cast<SizeT>(n), sizeof(buffer) - static_cast<SizeT>(1));
|
||||
std::string out = header +
|
||||
#if MOBILEGL_LOG_ENABLE_STACKTRACE
|
||||
padding +
|
||||
#endif
|
||||
std::string(buffer, n) + "\n";
|
||||
std::string(buffer, messageLength) + "\n";
|
||||
|
||||
#if MOBILEGL_LOG_ENABLE_CONSOLE
|
||||
std::fwrite(out.c_str(), 1, out.size(), stdout);
|
||||
|
||||
Reference in New Issue
Block a user