From f9df96d70ee50f4560fd50fb7c21407d52d25c25 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 15 Mar 2025 01:24:44 +0300 Subject: [PATCH] engine: server: fix server strings deduplication on 64-bit systems --- engine/server/sv_game.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index 1cd9d2da..44248591 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -3125,7 +3125,6 @@ static void SV_AllocStringPool( void ) if( ptr ) { Con_Reportf( "%s: Allocated string array near the server library: %p %p\n", __func__, base, ptr ); - } else { @@ -3253,9 +3252,14 @@ string_t GAME_EXPORT SV_AllocString( const char *szValue ) #if XASH_64BIT if( !str64.allowdup ) { - for( dupe_string = str64.poldstringbase + 1; - dupe_string < str64.plast && ( found_dupe = !Q_strcmp( dupe_string, processed_string )); - dupe_string += Q_strlen( dupe_string ) + 1 ); + for( dupe_string = str64.poldstringbase + 1; dupe_string < str64.plast; dupe_string += Q_strlen( dupe_string ) + 1 ) + { + if( !Q_strcmp( dupe_string, processed_string )) + { + found_dupe = true; + break; + } + } } if( !found_dupe )