diff --git a/engine/platform/win32/lib_win.c b/engine/platform/win32/lib_win.c index 21ee1fab..b3a74b79 100644 --- a/engine/platform/win32/lib_win.c +++ b/engine/platform/win32/lib_win.c @@ -354,6 +354,7 @@ static void ListMissingModules( dll_user_t *hInst ) PIMAGE_NT_HEADERS peHeader; PIMAGE_IMPORT_DESCRIPTOR importDesc; byte *data; + char buf[MAX_VA_STRING]; if ( !hInst ) return; @@ -374,7 +375,10 @@ static void ListMissingModules( dll_user_t *hInst ) hMod = LoadLibraryEx( importName, NULL, LOAD_LIBRARY_AS_DATAFILE ); if ( !hMod ) - COM_PushLibraryError( va( "%s not found!", importName ) ); + { + Q_snprintf( buf, sizeof( buf ), "%s not found!", importName ); + COM_PushLibraryError( buf ); + } else FreeLibrary( hMod ); } @@ -436,19 +440,22 @@ smart dll loader - can loading dlls from pack or wad files void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean directpath ) { dll_user_t *hInst; + char buf[MAX_VA_STRING]; COM_ResetLibraryError(); hInst = FS_FindLibrary( dllname, directpath ); if( !hInst ) { - COM_PushLibraryError( va( "Failed to find library %s", dllname ) ); + Q_snprintf( buf, sizeof( buf ), "Failed to find library %s", dllname ); + COM_PushLibraryError( buf ); return NULL; } if( hInst->encrypted ) { - COM_PushLibraryError( va( "Library %s is encrypted, cannot load", hInst->shortPath ) ); + Q_snprintf( buf, sizeof( buf ), "Library %s is encrypted, cannot load", hInst->shortPath ); + COM_PushLibraryError( buf ); COM_FreeLibrary( hInst ); return NULL; } @@ -480,7 +487,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d { if( !LibraryLoadSymbols( hInst )) { - COM_PushLibraryError( va( "Failed to load library %s", dllname ) ); + Q_snprintf( buf, sizeof( buf ), "Failed to load library %s", dllname ); + COM_PushLibraryError( buf ); COM_FreeLibrary( hInst ); return NULL; }