mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Fixed msg_fparse() for correct handling of empty lines and superfluous whitespaces
This commit is contained in:
parent
a7beb10458
commit
3dc38c0c22
2 changed files with 2 additions and 2 deletions
|
@ -231,7 +231,7 @@ int file_read(struct node *n, struct msg *pool, int poolsize, int first, int cnt
|
|||
values = msg_fscan(f->in, cur, &flags, NULL);
|
||||
if (values < 0) {
|
||||
if (!feof(f->in))
|
||||
warn("Failed to parse file of node '%s", n->name);
|
||||
warn("Failed to parse file of node '%s': reason=%d", n->name, values);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ skip: if (fgets(line, sizeof(line), f) == NULL)
|
|||
return -1; /* An error occured */
|
||||
|
||||
/* Skip whitespaces, empty and comment lines */
|
||||
for (ptr = line; isblank(*ptr); ptr++);
|
||||
for (ptr = line; isspace(*ptr); ptr++);
|
||||
if (*ptr == '\0' || *ptr == '#')
|
||||
goto skip;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue