1
0
Fork 0
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:
Steffen Vogel 2015-10-09 17:32:35 +02:00
parent 3c7a52834f
commit a7beb10458

View file

@ -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 */