1
0
mirror of https://code.semirocket.science/wrapsix synced 2024-11-21 21:41:07 +02:00

Slightly better handling of incorrect config files

This commit is contained in:
xHire 2017-05-16 09:01:45 +02:00
parent be5743c099
commit 64907ebf5c

View File

@ -98,7 +98,7 @@ int cfg_parse(const char *config_file, unsigned short *cmtu,
/* comments */ /* comments */
if (c == '#') { if (c == '#') {
/* skip this line */ /* skip this line */
while (c = getc(f), c != '\n'); while (c = getc(f), c != '\n' && !feof(f));
continue; continue;
} }
@ -155,7 +155,7 @@ int cfg_parse(const char *config_file, unsigned short *cmtu,
/* skip rest of this line */ /* skip rest of this line */
if (c != '\n') { if (c != '\n') {
while (c = getc(f), c != '\n'); while (c = getc(f), c != '\n' && !feof(f));
} }
/* recognize the option */ /* recognize the option */