mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Fix log format misuse
Harden log channel methods against non-constant string.
This commit is contained in:
parent
a29d4150df
commit
8f604ddded
4 changed files with 8 additions and 8 deletions
|
@ -72,8 +72,8 @@ namespace logs
|
||||||
|
|
||||||
#define GEN_LOG_METHOD(_sev)\
|
#define GEN_LOG_METHOD(_sev)\
|
||||||
const message msg_##_sev{this, level::_sev};\
|
const message msg_##_sev{this, level::_sev};\
|
||||||
template <typename... Args>\
|
template <std::size_t N, typename... Args>\
|
||||||
void _sev(const char* fmt, const Args&... args)\
|
void _sev(const char(&fmt)[N], const Args&... args)\
|
||||||
{\
|
{\
|
||||||
if (UNLIKELY(level::_sev <= enabled))\
|
if (UNLIKELY(level::_sev <= enabled))\
|
||||||
{\
|
{\
|
||||||
|
|
|
@ -209,11 +209,11 @@ error_code cellMsgDialogOpen2(u32 type, vm::cptr<char> msgString, vm::ptr<CellMs
|
||||||
|
|
||||||
if (_type.se_normal)
|
if (_type.se_normal)
|
||||||
{
|
{
|
||||||
cellSysutil.warning(msgString.get_ptr());
|
cellSysutil.warning("%s", msgString);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cellSysutil.error(msgString.get_ptr());
|
cellSysutil.error("%s", msgString);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto manager = g_fxo->get<rsx::overlays::display_manager>())
|
if (auto manager = g_fxo->get<rsx::overlays::display_manager>())
|
||||||
|
|
|
@ -149,7 +149,7 @@ void pngDecEndCallback(png_structp png_ptr, png_infop info)
|
||||||
// Custom error handler for libpng
|
// Custom error handler for libpng
|
||||||
void pngDecError(png_structp png_ptr, png_const_charp error_message)
|
void pngDecError(png_structp png_ptr, png_const_charp error_message)
|
||||||
{
|
{
|
||||||
cellPngDec.error(error_message);
|
cellPngDec.error("%s", error_message);
|
||||||
// we can't return here or libpng blows up
|
// we can't return here or libpng blows up
|
||||||
throw LibPngCustomException("Fatal Error in libpng");
|
throw LibPngCustomException("Fatal Error in libpng");
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ void pngDecError(png_structp png_ptr, png_const_charp error_message)
|
||||||
// Custom warning handler for libpng
|
// Custom warning handler for libpng
|
||||||
void pngDecWarning(png_structp png_ptr, png_const_charp error_message)
|
void pngDecWarning(png_structp png_ptr, png_const_charp error_message)
|
||||||
{
|
{
|
||||||
cellPngDec.warning(error_message);
|
cellPngDec.warning("%s", error_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the chunk information of the PNG file. IDAT is marked as existing, only after decoding or reading the header.
|
// Get the chunk information of the PNG file. IDAT is marked as existing, only after decoding or reading the header.
|
||||||
|
|
|
@ -257,7 +257,7 @@ bool gdb_thread::read_cmd(gdb_cmd& out_cmd)
|
||||||
}
|
}
|
||||||
catch (const std::runtime_error& e)
|
catch (const std::runtime_error& e)
|
||||||
{
|
{
|
||||||
gdbDebugServer.error(e.what());
|
gdbDebugServer.error("%s", e.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -855,7 +855,7 @@ void gdb_thread::operator()()
|
||||||
client_socket = -1;
|
client_socket = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdbDebugServer.error(e.what());
|
gdbDebugServer.error("%s", e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue