Fixed minor issues in config file reader

Removed hardcoded values from long lines handling and made sure that pointer to the last character is always initialized
This commit is contained in:
alexey.lysiuk 2017-03-05 13:07:51 +02:00
parent 27376b1697
commit 5d3244c3a7

View file

@ -644,8 +644,12 @@ bool FConfigFile::ReadConfig (void *file)
continue;
}
// Do not process tail of long line
const bool longline = 255 == strlen(readbuf) && '\n' != readbuf[254];
if (!longline)
const bool longline = (READBUFFERSIZE - 1) == strlen(readbuf) && '\n' != readbuf[READBUFFERSIZE - 2];
if (longline)
{
endpt = start + READBUFFERSIZE - 2;
}
else
{
// Remove white space at end of line
endpt = start + strlen (start) - 1;