From ba33252652d85a0602f7b8b26c3d0762b509709b Mon Sep 17 00:00:00 2001 From: toadkarter Date: Tue, 26 Sep 2023 14:08:47 +0100 Subject: [PATCH] Removing main_msg intermediary variable and tidy-up --- cheevos/cheevos.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index 1016807eff9c..5e87639d0797 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -684,7 +684,8 @@ int rcheevos_get_richpresence(char *s, size_t len) int _len = snprintf(s, len, msg_hash_to_str(MSG_CHEEVOS_RICH_PRESENCE_PLAYING), rcheevos_locals.game.title); - if (_len < 0) { return -1; } + if (_len < 0) + return -1; } return ret; } @@ -1755,7 +1756,6 @@ static void rcheevos_show_game_placard(void) else { char number_of_unsupported_msg[64]; - char main_msg[256]; int _len; snprintf(number_of_unsupported_msg, @@ -1764,19 +1764,20 @@ static void rcheevos_show_game_placard(void) number_of_unsupported); if (settings->bools.cheevos_start_active) - snprintf(main_msg, sizeof(main_msg), + snprintf(msg, sizeof(msg), msg_hash_to_str(MSG_CHEEVOS_ALL_ACHIEVEMENTS_ACTIVATED), number_of_core); else - snprintf(main_msg, sizeof(main_msg), + snprintf(msg, sizeof(msg), msg_hash_to_str(MSG_CHEEVOS_NUMBER_ACHIEVEMENTS_UNLOCKED), number_of_core - number_of_active - number_of_unsupported, number_of_core); _len = snprintf(msg, sizeof(msg), - "%s (%s)", main_msg, number_of_unsupported_msg); + "%s (%s)", msg, number_of_unsupported_msg); - if (_len < 0) { return; } + if (_len < 0) + return; } msg[sizeof(msg) - 1] = 0;