]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Settings.cpp
Switched all data access to the new methods
[lugaru.git] / Source / Settings.cpp
index 609b9fdd8b0b0233bc1cf15adaca31577e446ff6..2ebfbfff3498633b73a23aa70bd0e1b1a5f57e95 100644 (file)
@@ -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];