From b648c748155225164695d946dae311f48f4b81d3 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sun, 18 Dec 2022 22:07:13 +0500 Subject: [PATCH] engine: platform: posix: replace va function calls. --- engine/platform/posix/lib_posix.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/engine/platform/posix/lib_posix.c b/engine/platform/posix/lib_posix.c index 315fc059..62c40346 100644 --- a/engine/platform/posix/lib_posix.c +++ b/engine/platform/posix/lib_posix.c @@ -82,6 +82,7 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d { dll_user_t *hInst = NULL; void *pHandle = NULL; + char buf[MAX_VA_STRING]; COM_ResetLibraryError(); @@ -110,7 +111,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d if( pHandle ) return pHandle; - COM_PushLibraryError( va( "Failed to find library %s", dllname )); + Q_snprintf( buf, sizeof( buf ), "Failed to find library %s", dllname ); + COM_PushLibraryError( buf ); COM_PushLibraryError( dlerror() ); return NULL; } @@ -118,7 +120,8 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d if( hInst->custom_loader ) { - COM_PushLibraryError( va( "Custom library loader is not available. Extract library %s and fix gameinfo.txt!", hInst->fullPath )); + Q_snprintf( buf, sizeof( buf ), "Custom library loader is not available. Extract library %s and fix gameinfo.txt!", hInst->fullPath ); + COM_PushLibraryError( buf ); Mem_Free( hInst ); return NULL; } @@ -128,14 +131,16 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d { 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 ); Mem_Free( hInst ); return NULL; } if( !( hInst->hInstance = Loader_LoadLibrary( hInst->fullPath ) ) ) { - COM_PushLibraryError( va( "Failed to load DLL with DLL loader: %s", hInst->shortPath ) ); + Q_snprintf( buf, sizeof( buf ), "Failed to load DLL with DLL loader: %s", hInst->shortPath ); + COM_PushLibraryError( buf ); Mem_Free( hInst ); return NULL; }