Skip to content

Commit

Permalink
Removing main_msg intermediary variable and tidy-up
Browse files Browse the repository at this point in the history
  • Loading branch information
toadkarter committed Sep 26, 2023
1 parent 2c192be commit ba33252
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cheevos/cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down

0 comments on commit ba33252

Please sign in to comment.