From de3339ebcda1999b386534bc581b8fa7272a846e Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Mon, 27 Mar 2017 04:11:33 -0700 Subject: [PATCH] Fill in filename in Com_WriteConfig_f() before checking extension. Thanks BartoCH for pointing out. --- code/qcommon/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/qcommon/common.c b/code/qcommon/common.c index f3cf1214..211a09cd 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -2975,6 +2975,8 @@ void Com_WriteConfig_f( void ) { return; } + Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) ); + COM_DefaultExtension( filename, sizeof( filename ), ".cfg" ); if (!COM_CompareExtension(filename, ".cfg")) { @@ -2982,8 +2984,6 @@ void Com_WriteConfig_f( void ) { return; } - Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) ); - COM_DefaultExtension( filename, sizeof( filename ), ".cfg" ); Com_Printf( "Writing %s.\n", filename ); Com_WriteConfigToFile( filename ); }