<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 23, 2019 at 3:58 PM Jan Stancek <<a href="mailto:jstancek@redhat.com">jstancek@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
----- Original Message -----<br>
> Maybe we can merge this string compare in the same for loops?<br>
> <br>
> e.g: <a href="http://pastebin.test.redhat.com/808028" rel="noreferrer" target="_blank">http://pastebin.test.redhat.com/808028</a><br>
<br>
Li, I don't think this is public server.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Sorry, thanks for the reminder.</div><div class="gmail_default" style="font-size:small">[I copied the below code to gmail, it always lost the indent]</div><div class="gmail_default" style="font-size:small"><br></div>static void print_failure_hints(void)<br>{<br> <span class="gmail_default" style="font-size:small"> </span>unsigned int i;<br> <span class="gmail_default" style="font-size:small"> </span>int hint_printed = 0;<br> <span class="gmail_default" style="font-size:small"> </span>const struct tst_tag *tags = tst_test->tags;<br><br> <span class="gmail_default" style="font-size:small"> </span>if (!tags)<br> <span class="gmail_default" style="font-size:small"> </span>return;<br><br> <span class="gmail_default" style="font-size:small"> </span>for (i = 0; tags[i].name; i++) {<br> <span class="gmail_default" style="font-size:small"> </span>if (!strcmp(tags[i].name, "linux-git")) {<br> <span class="gmail_default" style="font-size:small"> </span>if (hint_printed != 1) {<br> <span class="gmail_default" style="font-size:small"> </span>hint_printed = 1;<br> <span class="gmail_default" style="font-size:small"> </span>print_colored("\nHINT: ");<br> <span class="gmail_default" style="font-size:small"> </span>printf("You _MAY_ be missing kernel fixes, see:\n\n");<br> <span class="gmail_default" style="font-size:small"> </span>}<br><br> <span class="gmail_default" style="font-size:small"> </span>printf(LINUX_GIT_URL "%s\n", tags[i].value);<br> <span class="gmail_default" style="font-size:small"> </span>} else if (!strcmp(tags[i].name, "CVE")) {<br> <span class="gmail_default" style="font-size:small"> </span>if (hint_printed != 2) {<br> <span class="gmail_default" style="font-size:small"> </span>hint_printed = 2;<br> <span class="gmail_default" style="font-size:small"> </span>print_colored("\nHINT: ");<br> <span class="gmail_default" style="font-size:small"> </span>printf("You _MAY_ be vunerable to CVE(s), see:\n\n");<br> <span class="gmail_default" style="font-size:small"> </span>}<br><br> <span class="gmail_default" style="font-size:small"> </span>printf(CVE_DB_URL "%s\n", tags[i].value);<br> <span class="gmail_default" style="font-size:small"> </span>} else {<br> <span class="gmail_default" style="font-size:small"> </span>print_colored("\nERROR: ");<br> <span class="gmail_default" style="font-size:small"> </span>printf("tags[%d].name should be linux-git or CVE\n", i);<br> <span class="gmail_default" style="font-size:small"> </span>return;<br> <span class="gmail_default" style="font-size:small"> </span>}<br><span class="gmail_default" style="font-size:small"> </span>}<span class="gmail_default" style="font-size:small"></span><br><div class="gmail_default" style="font-size:small">}</div></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>