From 41a976b5f0dea79769eaf6a92e12f942e5a48ce7 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sat, 2 Jul 2022 21:49:00 +0400 Subject: [PATCH] Suppress a GCC 11's format-overflow warning --- apps/openmw/mwgui/waitdialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/waitdialog.cpp b/apps/openmw/mwgui/waitdialog.cpp index 6fd96ea554..53194e4f3f 100644 --- a/apps/openmw/mwgui/waitdialog.cpp +++ b/apps/openmw/mwgui/waitdialog.cpp @@ -159,9 +159,9 @@ namespace MWGui if (hour == 0) hour = 12; ESM::EpochTimeStamp currentDate = MWBase::Environment::get().getWorld()->getEpochTimeStamp(); - int daysPassed = MWBase::Environment::get().getWorld()->getTimeStamp().getDay(); - const char* formattedHour = pm ? "#{sSaveMenuHelp05}" : "#{sSaveMenuHelp04}"; - std::string dateTimeText = Misc::StringUtils::format("%i %s (#{sDay} %i) %i %s", currentDate.mDay, month, daysPassed, hour, formattedHour); + std::string daysPassed = Misc::StringUtils::format("(#{sDay} %i)", MWBase::Environment::get().getWorld()->getTimeStamp().getDay()); + std::string formattedHour(pm ? "#{sSaveMenuHelp05}" : "#{sSaveMenuHelp04}"); + std::string dateTimeText = Misc::StringUtils::format("%i %s %s %i %s", currentDate.mDay, month, daysPassed, hour, formattedHour); mDateTimeText->setCaptionWithReplacing (dateTimeText); }