From c88b283f3d78d78c18a128190da374696f8b479d Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Thu, 7 Jul 2016 23:02:09 +0200 Subject: [PATCH] small bug fix for reading settings --- settings.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/settings.cpp b/settings.cpp index ca313fa1..be340bad 100644 --- a/settings.cpp +++ b/settings.cpp @@ -26,21 +26,22 @@ void Settings::load() { ifstream infile(settingsFilePath); string value; string line; - size_t pos = string::npos; + size_t pos; int numValues; bool startMessageDisableFound = false; infile.seekg(0); while (infile.good()) { + pos = line.npos; numValues = 0; //read json file getline(infile, line); //disable the start message? if (!startMessageDisableFound) { pos = line.find("\"StartMessageDisable\": "); - if (pos != string::npos) { + if (pos != line.npos) { startMessageDisableFound = true; - startMessageDisable = line.find("true") == string::npos ? false : true; + startMessageDisable = line.find("true") == line.npos ? false : true; } } //get switcher info