From 5d6251038808b10b24b8940deb92bd3d595daea7 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Thu, 13 Jun 2024 06:20:18 +0200 Subject: [PATCH] (cheevos) Use strlcpy where possible --- cheevos/cheevos.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index e9dafd58ab..097b4708ec 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -457,20 +457,14 @@ static void rcheevos_award_achievement(const rc_client_achievement_t* cheevo) cheevo->rarity_hardcore : cheevo->rarity; if (rarity >= 10.0) - { snprintf(title, sizeof(title), "%s - %0.2f%%", msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED), rarity); - } else if (rarity > 0.0) - { snprintf(title, sizeof(title), "%s - %0.2f%%", msg_hash_to_str(MSG_RARE_ACHIEVEMENT_UNLOCKED), rarity); - } else - { - snprintf(title, sizeof(title), "%s", - msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED)); - } + strlcpy(title, + msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED), sizeof(title)); snprintf(subtitle, sizeof(subtitle), "%s (%d)", cheevo->title, cheevo->points);