From a0b40fc2dadff516af522e14bfbd0c37516f86a5 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 6 Nov 2025 20:05:46 +0500 Subject: [PATCH] engine: common: explicitly cast function offset into size_t, even though it's signed ptrdiff, saverestore offset mistakingly used unsigned numbers --- engine/common/lib_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/common/lib_common.c b/engine/common/lib_common.c index 7d20b5c4..d3c1a5fc 100644 --- a/engine/common/lib_common.c +++ b/engine/common/lib_common.c @@ -81,7 +81,7 @@ void *COM_FunctionFromName_SR( void *hInstance, const char *pName ) const char *COM_OffsetNameForFunction( void *function ) { static string sname; - Q_snprintf( sname, MAX_STRING, "ofs:%zu", ((byte*)function - (byte*)svgame.dllFuncs.pfnGameInit) ); + Q_snprintf( sname, MAX_STRING, "ofs:%zu", (size_t)((byte*)function - (byte*)svgame.dllFuncs.pfnGameInit )); Con_Reportf( "%s: %s\n", __func__, sname ); return sname; }