filesystem: add size argument to COM_Default/ReplaceExtension calls

This commit is contained in:
Alibek Omarov 2023-04-26 04:58:51 +03:00
parent ec2951cf45
commit 71a3cedba8
2 changed files with 5 additions and 6 deletions

View File

@ -655,7 +655,7 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool
{
pfile = COM_ParseFile( pfile, GameInfo->iconpath, sizeof( GameInfo->iconpath ));
COM_FixSlashes( GameInfo->iconpath );
COM_DefaultExtension( GameInfo->iconpath, ".ico" );
COM_DefaultExtension( GameInfo->iconpath, ".ico", sizeof( GameInfo->iconpath ));
}
else if( !Q_stricmp( token, "type" ))
{
@ -1229,7 +1229,7 @@ static qboolean FS_FindLibrary( const char *dllname, qboolean directpath, fs_dll
}
dllInfo->shortPath[i] = '\0';
COM_DefaultExtension( dllInfo->shortPath, "."OS_LIB_EXT ); // apply ext if forget
COM_DefaultExtension( dllInfo->shortPath, "."OS_LIB_EXT, sizeof( dllInfo->shortPath )); // apply ext if forget
search = FS_FindFile( dllInfo->shortPath, &index, NULL, 0, false );

View File

@ -467,13 +467,12 @@ static int FS_FindFile_WAD( searchpath_t *search, const char *path, char *fixedn
Q_strncpy( wadfolder, wadbasename, sizeof( wadfolder ));
Q_snprintf( wadname, sizeof( wadname ), "%s.wad", wadbasename );
anywadname = false;
}
// make wadname from wad fullpath
COM_FileBase( search->filename, shortname, sizeof( shortname ));
COM_DefaultExtension( shortname, ".wad" );
COM_DefaultExtension( shortname, ".wad", sizeof( shortname ));
// quick reject by wadname
if( !anywadname && Q_stricmp( wadname, shortname ))
@ -532,7 +531,7 @@ static void FS_Search_WAD( searchpath_t *search, stringlist_t *list, const char
// make wadname from wad fullpath
COM_FileBase( search->filename, temp2, sizeof( temp2 ));
COM_DefaultExtension( temp2, ".wad" );
COM_DefaultExtension( temp2, ".wad", sizeof( temp2 ));
// quick reject by wadname
if( !anywadname && Q_stricmp( wadname, temp2 ))
@ -562,7 +561,7 @@ static void FS_Search_WAD( searchpath_t *search, stringlist_t *list, const char
// build path: wadname/lumpname.ext
Q_snprintf( temp2, sizeof( temp2 ), "%s/%s", wadfolder, temp );
Q_snprintf( buf, sizeof( buf ), ".%s", W_ExtFromType( search->wad->lumps[i].type ));
COM_DefaultExtension( temp2, buf );
COM_DefaultExtension( temp2, buf, sizeof( temp2 ));
stringlistappend( list, temp2 );
}
}