From 0f31dce9385cf2f2be4ac703fa00adeae795121f Mon Sep 17 00:00:00 2001 From: dP Date: Sun, 3 Oct 2021 21:03:52 +0300 Subject: [PATCH] Fix regression test crash --- src/video/null_v.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp index 2b77557dc5..6852a559be 100644 --- a/src/video/null_v.cpp +++ b/src/video/null_v.cpp @@ -31,7 +31,8 @@ const char *VideoDriver_Null::Start(const StringList &parm) this->UpdateAutoResolution(); this->ticks = GetDriverParamInt(parm, "ticks", 1000); - this->savefile = GetDriverParam(parm, "save"); + auto saveptr = GetDriverParam(parm, "save"); + this->savefile = saveptr ? saveptr : ""; _screen.width = _screen.pitch = _cur_resolution.width; _screen.height = _cur_resolution.height; _screen.dst_ptr = nullptr; @@ -60,7 +61,7 @@ void VideoDriver_Null::MainLoop() if (old_tick != _tick_counter) i++; else _pause_mode = PM_UNPAUSED; } - fprintf(stderr, "Null driver ran for %u tics, save: %s\n", this->ticks, this->savefile.c_str()); + IConsolePrint(CC_DEFAULT, "Null driver ran for {} tics, save: {}", this->ticks, this->savefile); if (!this->savefile.empty()) { if (SaveOrLoad(this->savefile.c_str(), SLO_SAVE, DFT_GAME_FILE, SAVE_DIR) != SL_OK) { IConsolePrint(CC_ERROR, "Error saving the final game state.");