Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix build with paranoid flags: remove redundant '\0' in string.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 14 Jun 2012 09:11:50 +0000 (11:11 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 14 Jun 2012 09:15:40 +0000 (11:15 +0200)
The reported error was:
src/instr/jedule/jedule_output.c: In function ‘get_hierarchy_string’:
src/instr/jedule/jedule_output.c:89:13: error: embedded ‘\0’ in format [-Werror=format-contains-nul]
src/instr/jedule/jedule_output.c:91:13: error: embedded ‘\0’ in format [-Werror=format-contains-nul]
cc1: all warnings being treated as errors

src/instr/jedule/jedule_output.c

index cafd545..7cb7af0 100644 (file)
@@ -86,9 +86,9 @@ static void get_hierarchy_string(jed_simgrid_container_t container, char *outbuf
     
     xbt_dynar_foreach(hier_list, iter, number) {
         if( iter != length-1 ) {
-            sprintf(buf, "%d.\0", number);
+            sprintf(buf, "%d.", number);
         } else {
-            sprintf(buf, "%d\0", number);
+            sprintf(buf, "%d", number);
         }
         strcat(outbuf, buf);
     }