Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
change mmalloc.h into a public header
[simgrid.git] / src / xbt / cunit.c
index 15d6afa..4572af1 100644 (file)
@@ -1,8 +1,7 @@
-/* $Id$ */
-
 /* cunit - A little C Unit facility                                         */
 
-/* Copyright (c) 2005 Martin Quinson. All rights reserved.                  */
+/* Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -267,7 +266,7 @@ static int xbt_test_suite_run(xbt_test_suite_t suite)
 
   /* suite title pretty-printing */
   {
-    char suite_title[80];
+    char suite_title[81];
     int suite_len = strlen(suite->title);
     int i;
 
@@ -276,15 +275,15 @@ static int xbt_test_suite_run(xbt_test_suite_t suite)
                 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[79] = '\0';
+    suite_title[80] = '\0';
 
     sprintf(suite_title + 40 - (suite_len + 4) / 2, "[ %s ]", suite->title);
     suite_title[40 + (suite_len + 5) / 2] = '=';
     if (!suite->enabled)
-      sprintf(suite_title + 70, " DISABLED ");
+      snprintf(suite_title + 70, 11, " DISABLED ");
     fprintf(stderr, "\n%s\n", suite_title);
   }