Update to keeping config comments (Feature #2535)

-An attempt to fix Coverity-Scan warning (see: https://github.com/OpenMW/openmw/pull/618#discussion_r33641670)
- Unable to test until a PR can be submitted.
pull/1955/head
cc9cii 10 years ago
parent 5538f822f4
commit da85b3a4ee

@ -291,7 +291,8 @@ bool Config::GameSettings::writeFileWithComments(QFile &file)
if (!comments.empty() && index != -1 && settingRegex.captureCount() >= 2 &&
mUserSettings.find(settingRegex.cap(1)) != mUserSettings.end())
{
for (std::vector<QString>::const_iterator it = comments.begin(); it != comments.end(); ++it)
for (std::vector<QString>::const_iterator it = comments.begin();
it != comments.end() && commentStart != fileCopy.end(); ++it)
{
*commentStart = *it;
++commentStart;

Loading…
Cancel
Save