]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/exception.cxx
two warning fixes
[simgear.git] / simgear / structure / exception.cxx
index c46a1c9636c25aac25b40dfca32469cf27385fd7..accd9706c264dc19f2e8d9dd836c7ce9444b10f2 100644 (file)
@@ -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';
   }
@@ -331,7 +331,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';
   }