Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
If the length of the description is more than 76 characters replace it by the name...
authorcherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 11 Aug 2008 12:03:43 +0000 (12:03 +0000)
committercherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 11 Aug 2008 12:03:43 +0000 (12:03 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5889 48e7efb5-ca39-0410-a469-dd3cf9ba447f

tools/tesh2/src/unit.c

index 43ba352..afadd9b 100644 (file)
@@ -536,13 +536,23 @@ unit_summuarize(unit_t unit)
         return -1;\r
     }\r
        \r
-       if((unit->description) && strlen(unit->description) < 78)\r
+       if((unit->description) && strlen(unit->description) < 76)\r
                strcpy(title, unit->description);\r
        else\r
                sprintf(title, "file : %s",unit->fstream->name);\r
                \r
        if(unit->interrupted)\r
-               strcat(title, " (interrupted)");\r
+       {\r
+               if(strlen(title) + strlen(" (interrupted)") < 76)\r
+                       strcat(title, " (interrupted)");\r
+               else\r
+               {\r
+                       memset(title, 0, PATH_MAX + 1);\r
+                       sprintf(title, "file : %s",unit->fstream->name);\r
+                       strcat(title, " (interrupted)");\r
+\r
+               }\r
+       }\r
                \r
        print_title(title);\r
        \r