From 2615f3c7e6e288803d02613388609d8a8f626958 Mon Sep 17 00:00:00 2001 From: superp00t Date: Fri, 22 Nov 2024 02:44:17 -0500 Subject: [PATCH] refactor(error): make printf function a little prettier --- storm/error/win/Display.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/storm/error/win/Display.cpp b/storm/error/win/Display.cpp index 6ee6785..cfdd413 100644 --- a/storm/error/win/Display.cpp +++ b/storm/error/win/Display.cpp @@ -18,14 +18,14 @@ class error_report { int32_t m_recoverable; void printf(const char *format, ...) { - va_list args; - va_start(args, format); - constexpr size_t size = 1024; 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); + // Remove trailing zero this->m_text.SetCount(this->m_text.Count()-1); // Add formatted bytes plus trailing zero