File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,12 @@ void Con_Dump_f (void)
191191 Q_strncpyz ( filename , Cmd_Argv ( 1 ), sizeof ( filename ) );
192192 COM_DefaultExtension ( filename , sizeof ( filename ), ".txt" );
193193
194+ if (!COM_CompareExtension (filename , ".txt" ))
195+ {
196+ Com_Printf ("Con_Dump_f: Only the \".txt\" extension is supported by this command!\n" );
197+ return ;
198+ }
199+
194200 f = FS_FOpenFileWrite ( filename );
195201 if (!f )
196202 {
Original file line number Diff line number Diff line change @@ -2975,6 +2975,13 @@ void Com_WriteConfig_f( void ) {
29752975 return ;
29762976 }
29772977
2978+
2979+ if (!COM_CompareExtension (filename , ".cfg" ))
2980+ {
2981+ Com_Printf ("Com_WriteConfig_f: Only the \".cfg\" extension is supported by this command!\n" );
2982+ return ;
2983+ }
2984+
29782985 Q_strncpyz ( filename , Cmd_Argv (1 ), sizeof ( filename ) );
29792986 COM_DefaultExtension ( filename , sizeof ( filename ), ".cfg" );
29802987 Com_Printf ( "Writing %s.\n" , filename );
You can’t perform that action at this time.
0 commit comments