From 0f07f888183299102c1dcf00df41a3a57a83ee16 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 24 Oct 2010 18:49:10 +0200 Subject: [PATCH] fclose only after a successful fopen and print an error message if fopen failed --- qcsrc/client/hud.qc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.39.2