X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2Fexception.cxx;h=0766eb4502f58b73cf8b4d9ab5e4954b03a02d56;hb=c955e61ba785a7b4699ed0a35f947fb661cab854;hp=c46a1c9636c25aac25b40dfca32469cf27385fd7;hpb=76948416a9624ba269d2baeac294c6db0853f104;p=simgear.git diff --git a/simgear/structure/exception.cxx b/simgear/structure/exception.cxx index c46a1c96..0766eb45 100644 --- a/simgear/structure/exception.cxx +++ b/simgear/structure/exception.cxx @@ -54,8 +54,8 @@ void sg_location::setPath (const char* path) { if (path) { - strncpy(_path, path, MAX_PATH); - _path[MAX_PATH -1] = '\0'; + strncpy(_path, path, max_path); + _path[max_path -1] = '\0'; } else { _path[0] = '\0'; } @@ -260,6 +260,14 @@ sg_io_exception::sg_io_exception (const string& message, const string& origin) { } +sg_io_exception::sg_io_exception (const string& message, + const sg_location &location, + const string& origin) + : sg_exception(message, origin), + _location(location) +{ +} + sg_io_exception::~sg_io_exception () throw () { } @@ -331,7 +339,7 @@ sg_format_exception::setText (const char* text) { if (text) { strncpy(_text, text, MAX_TEXT_LEN); - _text[MAX_TEXT_LEN] = '\0'; + _text[MAX_TEXT_LEN-1] = '\0'; } else { _text[0] = '\0'; }