From 8e3ba6c6d358ae0d72414f28815d970120077fd1 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 10 Oct 2012 11:13:10 +0200 Subject: [PATCH] Abort if getline failed. --- examples/smpi/MM/param.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/smpi/MM/param.c b/examples/smpi/MM/param.c index a72e75c615..59c94ac658 100644 --- a/examples/smpi/MM/param.c +++ b/examples/smpi/MM/param.c @@ -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; - 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); -- 2.20.1