From 702197a67de03427a5e0126bfad9b3afb958fd95 Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Sat, 2 Nov 2024 18:15:05 -0600 Subject: [PATCH] cleanup fatal, flush is done in message handler. --- fatal.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/fatal.cc b/fatal.cc index 897b1a8ad..f1fe8a8ef 100644 --- a/fatal.cc +++ b/fatal.cc @@ -19,15 +19,15 @@ */ -#include // for va_end, va_list, va_start -#include // for fflush, stdout +#include // for va_copy, va_end, va_list, va_start +#include // for vsnprintf #include // for exit #include // for QDebug #include // for QString -#include // for qDebug +#include // for qCritical, qDebug, qInfo, qWarning -#include "defs.h" // for Fatal, debug_print, fatal, warning +#include "defs.h" // for DebugLog, fatal, debug, info, warning #include "src/core/logging.h" // for FatalMsg @@ -42,9 +42,6 @@ [[noreturn]] void fatal(const char* fmt, ...) { - /* flush any buffered standard output */ - fflush(stdout); - va_list ap; va_start(ap, fmt); QString msg = QString::vasprintf(fmt, ap); @@ -99,7 +96,7 @@ int DebugLog::vlog(const char* fmt, va_list args1) { va_list args2; va_copy(args2, args1); - size_t cbufsz = 1 + vsnprintf(nullptr, 0, fmt, args1); + auto cbufsz = 1 + vsnprintf(nullptr, 0, fmt, args1); char* cbuf = new char[cbufsz]; vsnprintf(cbuf, cbufsz, fmt, args2); va_end(args2);