Browse Source

utils: mdldec: add size argument to COM_FileBase calls

pull/2/head
Alibek Omarov 2 years ago
parent
commit
cfdfdd5c93
  1. 2
      utils/mdldec/mdldec.c
  2. 4
      utils/mdldec/qc.c
  3. 2
      utils/mdldec/smd.c
  4. 2
      utils/mdldec/texture.c

2
utils/mdldec/mdldec.c

@ -244,7 +244,7 @@ static qboolean LoadMDL( const char *modelname )
} }
} }
COM_FileBase( modelname, modelfile ); COM_FileBase( modelname, modelfile, sizeof( modelfile ));
SequenceNameFix(); SequenceNameFix();

4
utils/mdldec/qc.c

@ -329,7 +329,7 @@ static void WriteBodyGroupInfo( FILE *fp )
{ {
model = (mstudiomodel_t *)( (byte *)model_hdr + bodypart->modelindex ); model = (mstudiomodel_t *)( (byte *)model_hdr + bodypart->modelindex );
COM_FileBase( model->name, modelname ); COM_FileBase( model->name, modelname, sizeof( modelname ));
fprintf( fp, "$body \"%s\" \"%s\"\n\n", bodypart->name, modelname ); fprintf( fp, "$body \"%s\" \"%s\"\n\n", bodypart->name, modelname );
continue; continue;
@ -349,7 +349,7 @@ static void WriteBodyGroupInfo( FILE *fp )
continue; continue;
} }
COM_FileBase( model->name, modelname ); COM_FileBase( model->name, modelname, sizeof( modelname ));
fprintf( fp, "studio \"%s\"\n", modelname ); fprintf( fp, "studio \"%s\"\n", modelname );
} }

2
utils/mdldec/smd.c

@ -465,7 +465,7 @@ static void WriteReferences( void )
if( !Q_strncmp( model->name, "blank", 5 ) ) if( !Q_strncmp( model->name, "blank", 5 ) )
continue; continue;
COM_FileBase( model->name, name ); COM_FileBase( model->name, name, sizeof( name ));
len = Q_snprintf( filename, MAX_SYSPATH, "%s%s.smd", destdir, name ); len = Q_snprintf( filename, MAX_SYSPATH, "%s%s.smd", destdir, name );

2
utils/mdldec/texture.c

@ -39,7 +39,7 @@ static void WriteBMP( mstudiotexture_t *texture )
bmp_t bmp_hdr = {0,}; bmp_t bmp_hdr = {0,};
size_t texture_size; size_t texture_size;
COM_FileBase( texture->name, texturename ); COM_FileBase( texture->name, texturename, sizeof( texturename ));
len = Q_snprintf( filename, MAX_SYSPATH, "%s%s.bmp", destdir, texturename ); len = Q_snprintf( filename, MAX_SYSPATH, "%s%s.bmp", destdir, texturename );
if( len == -1 ) if( len == -1 )

Loading…
Cancel
Save