Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Get rid of "%s" in second argument of function xbt_str_parse_*.
[simgrid.git] / examples / c / platform-failures / platform-failures.c
index 527048a..4472b55 100644 (file)
@@ -10,9 +10,9 @@
 #include "simgrid/host.h"
 #include "simgrid/mailbox.h"
 
-#include "xbt/asserts.h"
 #include "xbt/log.h"
 #include "xbt/str.h"
+#include "xbt/sysdep.h"
 
 #include <stdio.h> /* snprintf */
 
@@ -23,10 +23,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(platform_failures, "Messages specific for this exam
 static void master(int argc, char* argv[])
 {
   xbt_assert(argc == 5);
-  long number_of_tasks  = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
-  double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
-  long task_comm_size   = xbt_str_parse_int(argv[3], "Invalid communication size: %s");
-  long workers_count    = xbt_str_parse_int(argv[4], "Invalid amount of workers: %s");
+  long number_of_tasks  = xbt_str_parse_int(argv[1], "Invalid amount of tasks");
+  double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size");
+  long task_comm_size   = xbt_str_parse_int(argv[3], "Invalid communication size");
+  long workers_count    = xbt_str_parse_int(argv[4], "Invalid amount of workers");
 
   XBT_INFO("Got %ld workers and %ld tasks to process", workers_count, number_of_tasks);
 
@@ -90,7 +90,7 @@ static void worker(int argc, char* argv[])
 {
   xbt_assert(argc == 2);
   char mailbox_name[80];
-  long id = xbt_str_parse_int(argv[1], "Invalid argument %s");
+  long id = xbt_str_parse_int(argv[1], "Invalid argument");
 
   snprintf(mailbox_name, 79, "worker-%ld", id);
   sg_mailbox_t mailbox = sg_mailbox_by_name(mailbox_name);