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: