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
1 changed files with 6 additions and 2 deletions

View File

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