Merge pull request #1001 from Mr0maks/master

Fix errors with va_list reported by cppcheck
This commit is contained in:
TotallyNotElite 2020-05-09 23:13:13 +02:00 committed by GitHub
commit d52feb47da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,9 +66,10 @@ void logging::Info(const char *fmt, ...)
// Allocate buffer
char result[512];
// Fill buffer
if (vsnprintf(result, 512, fmt, list) < 0)
return;
int size = vsnprintf(result, 512, fmt, list);
va_end(list);
if(size < 0)
return;
Log(result, false);
#endif
@ -85,9 +86,10 @@ void logging::File(const char *fmt, ...)
// Allocate buffer
char result[512];
// Fill buffer
if (vsnprintf(result, 512, fmt, list) < 0)
return;
int size = vsnprintf(result, 512, fmt, list);
va_end(list);
if(size < 0)
return;
Log(result, true);
#endif