X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FSettings.cpp;h=2ebfbfff3498633b73a23aa70bd0e1b1a5f57e95;hb=757fd9c1ec8d263225df90ef486051712f448483;hp=609b9fdd8b0b0233bc1cf15adaca31577e446ff6;hpb=8d45019f2b1ac74108ae4589333680158fee32d5;p=lugaru.git diff --git a/Source/Settings.cpp b/Source/Settings.cpp index 609b9fd..2ebfbff 100644 --- a/Source/Settings.cpp +++ b/Source/Settings.cpp @@ -81,6 +81,10 @@ void SaveSettings() if (newscreenheight < 0) newscreenheight = screenheight; ofstream opstream(Folders::getConfigFilePath()); + if (opstream.fail()) { + perror(("Couldn't save config file " + Folders::getConfigFilePath()).c_str()); + return; + } opstream << "Screenwidth:\n"; opstream << newscreenwidth; opstream << "\nScreenheight:\n"; @@ -169,8 +173,8 @@ void SaveSettings() bool LoadSettings() { ifstream ipstream(Folders::getConfigFilePath(), std::ios::in); - if ( !ipstream || ipstream.fail() ) { - printf("Config file not found\n"); + if ( ipstream.fail() ) { + perror(("Couldn't read config file " + Folders::getConfigFilePath()).c_str()); return false; } char setting[256];