mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
refactor(error): make printf function a little prettier
This commit is contained in:
parent
7f051cfec4
commit
2615f3c7e6
1 changed files with 4 additions and 4 deletions
|
|
@ -18,14 +18,14 @@ class error_report {
|
||||||
int32_t m_recoverable;
|
int32_t m_recoverable;
|
||||||
|
|
||||||
void printf(const char *format, ...) {
|
void printf(const char *format, ...) {
|
||||||
va_list args;
|
|
||||||
va_start(args, format);
|
|
||||||
|
|
||||||
constexpr size_t size = 1024;
|
constexpr size_t size = 1024;
|
||||||
char buf[size] = {0};
|
char buf[size] = {0};
|
||||||
auto n = vsnprintf(buf, size, format, args);
|
|
||||||
|
|
||||||
|
va_list args;
|
||||||
|
va_start(args, format);
|
||||||
|
auto n = vsnprintf(buf, size, format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
// Remove trailing zero
|
// Remove trailing zero
|
||||||
this->m_text.SetCount(this->m_text.Count()-1);
|
this->m_text.SetCount(this->m_text.Count()-1);
|
||||||
// Add formatted bytes plus trailing zero
|
// Add formatted bytes plus trailing zero
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue