tools: acrnd: Ignore null line reading from timer_list

Error msg "Invalid vmname from timer list file" will be print out when we read
a null line of file timer_list. It is a litte bit confusing. So, ignore null line
silently to avoid such confusing msg.

Tracked-On: #1517
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
This commit is contained in:
Kaige Fu 2018-10-17 13:54:28 +00:00 committed by Xie, Nanlin
parent a45d961bf8
commit da3b02702f
1 changed files with 6 additions and 2 deletions

View File

@ -162,7 +162,11 @@ static int load_timer_list(void)
while (!feof(fp)) { while (!feof(fp)) {
memset(l, 0, 256); memset(l, 0, 256);
fgets(l, 255, fp);
/* Ignore null line */
if (!fgets(l, 255, fp)) {
continue;
}
memset(s1, 0, 16); memset(s1, 0, 16);
memset(s2, 0, 64); memset(s2, 0, 64);
@ -170,7 +174,7 @@ static int load_timer_list(void)
sscanf(l, "%s\t%s", s1, s2); sscanf(l, "%s\t%s", s1, s2);
if (strlen(s1) == 0 || strlen(s1) > 16) { if (strlen(s1) == 0 || strlen(s1) > 16) {
perror("Invalid vmname from timer list file"); fprintf(stderr, "Invalid vmname %s from timer list file\n", s1);
continue; continue;
} }