diff --git a/SDL2pp/Exception.cc b/SDL2pp/Exception.cc index 546ade5..463415c 100644 --- a/SDL2pp/Exception.cc +++ b/SDL2pp/Exception.cc @@ -36,7 +36,7 @@ const char* Exception::what() const noexcept { } const char* Exception::GetSDLError() const noexcept { - return sdl_error_; + return sdl_error_.c_str(); } } // namespace SDL2pp diff --git a/SDL2pp/Exception.hh b/SDL2pp/Exception.hh index 4e6b8e4..c6fb5cf 100644 --- a/SDL2pp/Exception.hh +++ b/SDL2pp/Exception.hh @@ -22,6 +22,7 @@ #ifndef SDL2PP_EXCEPTION_HH #define SDL2PP_EXCEPTION_HH +#include #include namespace SDL2pp { @@ -29,7 +30,7 @@ namespace SDL2pp { class Exception : public std::exception { private: const char* what_; - const char* sdl_error_; + std::string sdl_error_; public: Exception(const char* what = "");