From: Arnaud Giersch Date: Thu, 20 Oct 2011 09:20:58 +0000 (+0200) Subject: tesh: do not fail on empty output, when sorting is enabled. X-Git-Tag: exp_20120216~555^2~5 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d5f0ad45f7340489424eff51f8e3dc158a6ffb02 tesh: do not fail on empty output, when sorting is enabled. --- diff --git a/tools/tesh/run_context.c b/tools/tesh/run_context.c index fa0c8ac220..f734a41c16 100644 --- a/tools/tesh/run_context.c +++ b/tools/tesh/run_context.c @@ -727,7 +727,7 @@ void *rctx_wait(void *r) if (rctx->output_sort) { xbt_dynar_sort(b, cmpstringp); /* If empty lines moved in first position, remove them */ - while (*xbt_dynar_getfirst_as(b, char *) == '\0') + while (!xbt_dynar_is_empty(b) && *xbt_dynar_getfirst_as(b, char*) == '\0') xbt_dynar_shift(b, NULL); }