]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/exception.cxx
Fix wrong difference calculation in SGExpression
[simgear.git] / simgear / structure / exception.cxx
index 821ae3248c373186bc457a6bab306258f7738434..0766eb4502f58b73cf8b4d9ab5e4954b03a02d56 100644 (file)
@@ -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';
   }