mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
made msg_fparse() more robust against strange files
This commit is contained in:
parent
3c7a52834f
commit
a7beb10458
1 changed files with 3 additions and 1 deletions
|
@ -93,7 +93,9 @@ int msg_fscan(FILE *f, struct msg *m, int *fl, double *off)
|
|||
skip: if (fgets(line, sizeof(line), f) == NULL)
|
||||
return -1; /* An error occured */
|
||||
|
||||
if (line[0] == '#')
|
||||
/* Skip whitespaces, empty and comment lines */
|
||||
for (ptr = line; isblank(*ptr); ptr++);
|
||||
if (*ptr == '\0' || *ptr == '#')
|
||||
goto skip;
|
||||
|
||||
/* Mandatory: seconds */
|
||||
|
|
Loading…
Add table
Reference in a new issue