From 09e9488de8a3343aeec4361d8cdc18e6659747fd Mon Sep 17 00:00:00 2001 From: sum2012 Date: Wed, 5 Oct 2022 06:22:40 +0800 Subject: [PATCH] Try to build fix --- UI/GameScreen.cpp | 5 +++-- UI/GameScreen.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index 114b6e7a35..89490193df 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -56,10 +56,11 @@ GameScreen::~GameScreen() { } } -std::string int2hexstr(const int a) { +const char* int2hexstr(const int a) { std::stringstream stream; stream << std::hex << a; - return stream.str(); + auto s = stream.str(); + return s.c_str(); } void GameScreen::update() { diff --git a/UI/GameScreen.h b/UI/GameScreen.h index 1018acbf10..43671ec272 100644 --- a/UI/GameScreen.h +++ b/UI/GameScreen.h @@ -29,7 +29,7 @@ // Uses GameInfoCache heavily to implement the functionality. // Should possibly merge this with the PauseScreen. -std::string int2hexstr(const int a); +const char* int2hexstr(const int a); class GameScreen : public UIDialogScreenWithGameBackground { public: