From 5d3244c3a7bf482eb13930b0cca8c9ab621b9658 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 5 Mar 2017 13:07:51 +0200 Subject: [PATCH] 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 --- src/configfile.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/configfile.cpp b/src/configfile.cpp index d56e74e9ae..3adbd3761b 100644 --- a/src/configfile.cpp +++ b/src/configfile.cpp @@ -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;