From f44a730a9073d2f223ea1ba6a8735a45235ffc90 Mon Sep 17 00:00:00 2001 From: Mat M Date: Thu, 4 Apr 2019 14:21:25 -0400 Subject: [PATCH] fatal_font: Add missing va_end() calls to PrintFormatLine() and PrintFormat() (#497) Fairly self-explanatory. Ensures va_start() is balanced with va_end() --- stratosphere/fatal/source/fatal_font.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/stratosphere/fatal/source/fatal_font.cpp b/stratosphere/fatal/source/fatal_font.cpp index 452bff06d..66d8cc178 100644 --- a/stratosphere/fatal/source/fatal_font.cpp +++ b/stratosphere/fatal/source/fatal_font.cpp @@ -126,12 +126,13 @@ void FontManager::PrintLine(const char *str) { } void FontManager::PrintFormatLine(const char *format, ...) { + char char_buf[0x400]; + va_list va_arg; va_start(va_arg, format); - - char char_buf[0x400]; vsnprintf(char_buf, sizeof(char_buf), format, va_arg); - + va_end(va_arg); + PrintLine(char_buf); } @@ -140,12 +141,13 @@ void FontManager::Print(const char *str) { } void FontManager::PrintFormat(const char *format, ...) { + char char_buf[0x400]; + va_list va_arg; va_start(va_arg, format); - - char char_buf[0x400]; vsnprintf(char_buf, sizeof(char_buf), format, va_arg); - + va_end(va_arg); + Print(char_buf); }