X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FException.hh;h=f8921bd5943cf161ee60036bd3d1f2ec3b564576;hp=a63f761ad8b857e8c63e81ca11e68df799f73828;hb=e495074443d9fd7bc16137084cf9de3d031b75c4;hpb=c9e20ac06383b20ceb5404c9237e319c2e90d157 diff --git a/src/Moof/Exception.hh b/src/Moof/Exception.hh index a63f761..f8921bd 100644 --- a/src/Moof/Exception.hh +++ b/src/Moof/Exception.hh @@ -31,6 +31,7 @@ #include #include +#include #include @@ -42,10 +43,10 @@ class Exception : public std::exception { public: - explicit Exception(unsigned code, const char* what = "") + explicit Exception(unsigned code, const std::string& what = "") { mWhat[sizeof(mWhat)-1] = '\0'; - strncpy(mWhat, what, sizeof(mWhat)-1); + strncpy(mWhat, what.c_str(), sizeof(mWhat)-1); mCode = code; } virtual ~Exception() throw() {} @@ -81,8 +82,8 @@ enum Code SCRIPT_ERROR, // description SDL_INIT, // description SDL_VIDEOMODE, // - - UNKNOWN_AUDIO_FORMAT, // - - UNKNOWN_IMAGE_FORMAT, // - + UNKNOWN_AUDIO_FORMAT, // name of resource + UNKNOWN_IMAGE_FORMAT, // name of resource }; } // namespace ErrorCode