Fixed bug at15479 (karlos)

Fixed bug at11812 (Kamikaze)
Added new build_pathname implementation for reentracy.
build_pathname_r added to module API
This commit is contained in:
David Anderson
2005-07-08 05:05:06 +00:00
parent e8d30a11d7
commit 35ecd40228
8 changed files with 90 additions and 37 deletions

View File

@ -51,7 +51,8 @@ void CPluginMngr::unloadPlugin( CPlugin** a ) {
int CPluginMngr::loadPluginsFromFile( const char* filename )
{
FILE *fp = fopen(build_pathname("%s",filename) , "rt");
char file[256];
FILE *fp = fopen(build_pathname_r(file, sizeof(file)-1, "%s",filename) , "rt");
if ( !fp )
{
@ -157,7 +158,8 @@ CPluginMngr::CPlugin::CPlugin(int i, const char* p,const char* n, char* e, int d
title.assign(unk);
author.assign(unk);
version.assign(unk);
char* path = build_pathname("%s/%s",p,n);
char file[256];
char* path = build_pathname_r(file, sizeof(file)-1, "%s/%s",p,n);
code = 0;
int err = load_amxscript(&amx,&code,path,e, d);
if ( err == AMX_ERR_NONE )