Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try harder not to overflow that buffer
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 29 Oct 2009 07:00:59 +0000 (07:00 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 29 Oct 2009 07:00:59 +0000 (07:00 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6819 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/cunit.c

index 57a988c..e32f486 100644 (file)
@@ -267,7 +267,7 @@ static int xbt_test_suite_run(xbt_test_suite_t suite)
 
   /* suite title pretty-printing */
   {
 
   /* suite title pretty-printing */
   {
-    char suite_title[80];
+    char suite_title[81];
     int suite_len = strlen(suite->title);
     int i;
 
     int suite_len = strlen(suite->title);
     int i;
 
@@ -276,10 +276,10 @@ static int xbt_test_suite_run(xbt_test_suite_t suite)
                 suite->title, suite_len);
 
     suite_title[0] = ' ';
                 suite->title, suite_len);
 
     suite_title[0] = ' ';
-    for (i = 1; i < 79; i++)
+    for (i = 1; i < 80; i++)
       suite_title[i] = '=';
     suite_title[i++] = '\n';
       suite_title[i] = '=';
     suite_title[i++] = '\n';
-    suite_title[79] = '\0';
+    suite_title[80] = '\0';
 
     sprintf(suite_title + 40 - (suite_len + 4) / 2, "[ %s ]", suite->title);
     suite_title[40 + (suite_len + 5) / 2] = '=';
 
     sprintf(suite_title + 40 - (suite_len + 4) / 2, "[ %s ]", suite->title);
     suite_title[40 + (suite_len + 5) / 2] = '=';