Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tesh: do not fail on empty output, when sorting is enabled.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 20 Oct 2011 09:20:58 +0000 (11:20 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 20 Oct 2011 09:48:53 +0000 (11:48 +0200)
tools/tesh/run_context.c

index fa0c8ac..f734a41 100644 (file)
@@ -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 */
     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);
     }
 
         xbt_dynar_shift(b, NULL);
     }