mirror of
https://code.semirocket.science/wrapsix
synced 2024-11-13 01:20:59 +02:00
Slightly better handling of incorrect config files
This commit is contained in:
parent
be5743c099
commit
64907ebf5c
@ -98,7 +98,7 @@ int cfg_parse(const char *config_file, unsigned short *cmtu,
|
||||
/* comments */
|
||||
if (c == '#') {
|
||||
/* skip this line */
|
||||
while (c = getc(f), c != '\n');
|
||||
while (c = getc(f), c != '\n' && !feof(f));
|
||||
|
||||
continue;
|
||||
}
|
||||
@ -155,7 +155,7 @@ int cfg_parse(const char *config_file, unsigned short *cmtu,
|
||||
|
||||
/* skip rest of this line */
|
||||
if (c != '\n') {
|
||||
while (c = getc(f), c != '\n');
|
||||
while (c = getc(f), c != '\n' && !feof(f));
|
||||
}
|
||||
|
||||
/* recognize the option */
|
||||
|
Loading…
Reference in New Issue
Block a user