From: terencehill Date: Sun, 24 Oct 2010 16:49:10 +0000 (+0200) Subject: fclose only after a successful fopen and print an error message if fopen failed X-Git-Tag: xonotic-v0.1.0preview~134^2~6^2~30 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0f07f888183299102c1dcf00df41a3a57a83ee16;p=xonotic%2Fxonotic-data.pk3dir.git fclose only after a successful fopen and print an error message if fopen failed --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 56853d5e4..2e9bcb4f1 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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;