Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Abort if getline failed.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 10 Oct 2012 09:13:10 +0000 (11:13 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 10 Oct 2012 09:19:43 +0000 (11:19 +0200)
examples/smpi/MM/param.c

index a72e75c..59c94ac 100644 (file)
@@ -105,7 +105,8 @@ char** get_conf(MPI_Comm comm, const char * filename, int mynoderank)
          * we rebuild the line to get every information*/
         char* line = NULL;
         number = 0;
          * we rebuild the line to get every information*/
         char* line = NULL;
         number = 0;
-        getline(&line,&number,conf);
+        if (getline(&line,&number,conf) == -1)
+          xbt_die("Cannot get line");
         char* line1 = NULL;
         asprintf(&line1,"%s %s %s",name,char_index,line);
         return get_list_param(line1);
         char* line1 = NULL;
         asprintf(&line1,"%s %s %s",name,char_index,line);
         return get_list_param(line1);