tst_test: Print tags only when defined.
PATCH 1/1 tst_test: Print tags only when defined.
We were printing the Tags heading even when no tags were defined.
Signed-off-by Cyril Hrubis <[email protected]>
--- lib/tst_test.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
lib/tst_test.c +10 -9
@@ -447,18 +447,19 @@ static void print_test_tags(void)unsigned int i;const struct tst_tag *tags = tst_test->tags; +if (!tags) +return ; +printf ("\nTags\n" );printf ("----\n" ); -if (tags) { -for (i =0 ; tags[i].name; i++) { -if (!strcmp (tags[i].name,"CVE" )) -printf (CVE_DB_URL "%s\n" , tags[i].value); -else if (!strcmp (tags[i].name,"linux-git" )) -printf (LINUX_GIT_URL "%s\n" , tags[i].value); -else -printf ("%s: %s\n" , tags[i].name, tags[i].value); - } +for (i =0 ; tags[i].name; i++) { +if (!strcmp (tags[i].name,"CVE" )) +printf (CVE_DB_URL "%s\n" , tags[i].value); +else if (!strcmp (tags[i].name,"linux-git" )) +printf (LINUX_GIT_URL "%s\n" , tags[i].value); +else +printf ("%s: %s\n" , tags[i].name, tags[i].value); }printf ("\n" );
Signature · 1 line
2.24.1