mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
code review changes
This commit is contained in:
@@ -20,7 +20,7 @@ void GpLogDriver_X::Init()
|
||||
|
||||
void GpLogDriver_X::VPrintf(Category category, const char *fmt, va_list args)
|
||||
{
|
||||
size_t fmtSize = 0;
|
||||
size_t fmtSize = 0;
|
||||
bool hasFormatting = false;
|
||||
for (const char *fmtCheck = fmt; *fmtCheck; fmtCheck++)
|
||||
{
|
||||
@@ -64,9 +64,9 @@ void GpLogDriver_X::VPrintf(Category category, const char *fmt, va_list args)
|
||||
}
|
||||
else
|
||||
{
|
||||
//a copy is needed if using va_list multiple times (otherwise unexpected output)
|
||||
va_list args_copy;
|
||||
va_copy(args_copy, args);
|
||||
//a copy is needed if using va_list multiple times (otherwise unexpected output)
|
||||
va_list args_copy;
|
||||
va_copy(args_copy, args);
|
||||
|
||||
int formattedSize = vsnprintf(nullptr, 0, fmt, args);
|
||||
if (formattedSize <= 0)
|
||||
@@ -77,7 +77,7 @@ void GpLogDriver_X::VPrintf(Category category, const char *fmt, va_list args)
|
||||
return;
|
||||
|
||||
vsnprintf(charBuff, formattedSize + 1, fmt, args_copy);
|
||||
va_end(args_copy);
|
||||
va_end(args_copy);
|
||||
|
||||
if (m_stream)
|
||||
m_stream->Write(charBuff, formattedSize);
|
||||
|
Reference in New Issue
Block a user