]> git.mxchange.org Git - simgear.git/commitdiff
Warning fix: array subscript is above array bounds
authortorsten <torsten>
Thu, 20 Aug 2009 08:32:31 +0000 (08:32 +0000)
committerTim Moore <timoore@redhat.com>
Sun, 23 Aug 2009 19:37:02 +0000 (21:37 +0200)
simgear/structure/exception.cxx

index 821ae3248c373186bc457a6bab306258f7738434..accd9706c264dc19f2e8d9dd836c7ce9444b10f2 100644 (file)
@@ -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';
   }