]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fclose only after a successful fopen and print an error message if fopen failed
authorterencehill <piuntn@gmail.com>
Sun, 24 Oct 2010 16:49:10 +0000 (18:49 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 24 Oct 2010 16:49:10 +0000 (18:49 +0200)
qcsrc/client/hud.qc

index 56853d5e41f9e0631e7e88bb4c93796c40bc535c..2e9bcb4f195d430376e20fd636c643b3ac6e812c 100644 (file)
@@ -525,8 +525,10 @@ void HUD_Panel_ExportCfg(string cfgname)
                HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
 
                print("^2Successfully exported to hud_", autocvar_hud_skin, "_", cfgname, ".cfg! (Note: It's saved in data/data/)\n");
+               fclose(fh);
        }
-       fclose(fh);
+       else
+               print("^1Couldn't write to hud_", autocvar_hud_skin, "_", cfgname, ".cfg\n");
 }
 
 const float hlBorderSize = 4;