From b1f33a4000018df57b9af40a4b2a38434ad0079d Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 20 Sep 2021 16:24:08 +0200 Subject: [PATCH] tests: len always initialized --- test/unit/run.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/unit/run.c b/test/unit/run.c index 24624aea9..84b867be5 100644 --- a/test/unit/run.c +++ b/test/unit/run.c @@ -125,8 +125,7 @@ static void _print_path_delta(FILE *stream, fprintf(stream, "\n"); } - if (new_len > 0) - len = common_prefix * 2 + (new[new_len - 1].e - new[new_len - 1].b); + len = (new_len > 0) ? common_prefix * 2 + (new[new_len - 1].e - new[new_len - 1].b) : 0; fprintf(stream, " "); for (d = len; d < 60; d++)