Merge some file writing extension checks from OpenJK.

Thanks Ensiform.
05928a57f9
ef124fd0fc
This commit is contained in:
SmileTheory 2017-03-13 20:44:47 -07:00
parent f61fe5f6a0
commit b173ac0599
2 changed files with 13 additions and 0 deletions

View file

@ -191,6 +191,12 @@ void Con_Dump_f (void)
Q_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );
COM_DefaultExtension( filename, sizeof( filename ), ".txt" );
if (!COM_CompareExtension(filename, ".txt"))
{
Com_Printf("Con_Dump_f: Only the \".txt\" extension is supported by this command!\n");
return;
}
f = FS_FOpenFileWrite( filename );
if (!f)
{