Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics from patch review
[simgrid.git] / src / xbt / cunit.c
index d4915f1..48393c4 100644 (file)
@@ -266,7 +266,7 @@ static int xbt_test_suite_run(xbt_test_suite_t suite, int verbosity)
     suite_title[i++] = '\n';
     suite_title[80] = '\0';
 
-    sprintf(suite_title + 40 - (suite_len + 4) / 2, "[ %s ]", suite->title);
+    snprintf(suite_title + 40 - (suite_len + 4) / 2, 81-(40 - (suite_len + 4)/ 2), "[ %s ]", suite->title);
     suite_title[40 + (suite_len + 5) / 2] = '=';
     if (!suite->enabled)
       snprintf(suite_title + 70, 11, " DISABLED ");
@@ -462,7 +462,7 @@ static void apply_selection(char *selection)
       dir[p - sel] = '\0';
       sel = p + 1;
     } else {
-      strcpy(dir, sel);
+      strncpy(dir, sel,1024);
       done = 1;
     }
 
@@ -477,11 +477,11 @@ static void apply_selection(char *selection)
 
     p = strchr(dir, ':');
     if (p) {
-      strcpy(unitname, p + 1);
+      strncpy(unitname, p + 1,512);
       strncpy(suitename, dir, p - dir);
       suitename[p - dir] = '\0';
     } else {
-      strcpy(suitename, dir);
+      strncpy(suitename, dir,512);
       unitname[0] = '\0';
     }