From 5cd933a9bb7ad8e532dd057a8c79fc1696845e69 Mon Sep 17 00:00:00 2001 From: Navarrop Date: Tue, 4 Oct 2011 18:34:53 +0200 Subject: [PATCH] Use xbt_dynar_foreach and xbt_dynar_cursor_rm for removing all lignes of coverage. --- tools/tesh/run_context.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tools/tesh/run_context.c b/tools/tesh/run_context.c index a0b20db9fc..338bf769c2 100644 --- a/tools/tesh/run_context.c +++ b/tools/tesh/run_context.c @@ -803,18 +803,16 @@ void *rctx_wait(void *r) xbt_dynar_sort(a,cmpstringp); if (coverage){ - int pos; - char* data; - for(pos=0;posoutput_got->used -= strlen(data)+1; - xbt_dynar_remove_at(a,pos,data); - pos--; - } - - } + char * ligne; + unsigned int cpt; + + xbt_dynar_foreach(a, cpt, ligne) { + if(!strncmp(ligne,"profiling:",strlen("profiling:"))){ + XBT_DEBUG("Remove line '%s'",ligne); + rctx->output_got->used -= strlen(ligne)+1; + xbt_dynar_cursor_rm(a,&cpt); + } + } } char *sorted_output = xbt_str_join(a, "\n"); -- 2.20.1