From 12bb0ca44b966b16c7ec3688ae07404b485ae455 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sun, 25 Dec 2022 05:35:06 +0500 Subject: [PATCH] engine: server: Fix broken description for saves. --- engine/server/sv_save.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/server/sv_save.c b/engine/server/sv_save.c index e3d791b3..08645645 100644 --- a/engine/server/sv_save.c +++ b/engine/server/sv_save.c @@ -2418,13 +2418,13 @@ int GAME_EXPORT SV_GetSaveComment( const char *savename, char *comment ) if( FBitSet( flags, MAP_INVALID_VERSION )) { - Q_snprintf( comment, sizeof( comment ), "", mapName ); + Q_snprintf( comment, MAX_STRING, "", mapName ); return 0; } if( !FBitSet( flags, MAP_IS_EXIST )) { - Q_snprintf( comment, sizeof( comment ), "", mapName ); + Q_snprintf( comment, MAX_STRING, "", mapName ); return 0; } @@ -2433,10 +2433,10 @@ int GAME_EXPORT SV_GetSaveComment( const char *savename, char *comment ) // split comment to sections if( Q_strstr( savename, "quick" )) - Q_snprintf( comment, sizeof( comment ), "[quick]%s", description ); + Q_snprintf( comment, CS_SIZE, "[quick]%s", description ); else if( Q_strstr( savename, "autosave" )) - Q_snprintf( comment, sizeof( comment ), "[autosave]%s", description ); - else Q_strncpy( comment, description, sizeof( comment )); + Q_snprintf( comment, CS_SIZE, "[autosave]%s", description ); + else Q_strncpy( comment, description, CS_SIZE ); strftime( timestring, sizeof ( timestring ), "%b%d %Y", file_tm ); Q_strncpy( comment + CS_SIZE, timestring, CS_TIME ); strftime( timestring, sizeof( timestring ), "%H:%M", file_tm );