From 1fffcc685e3073ec1aeccf03a5d48a3f501a1279 Mon Sep 17 00:00:00 2001 From: Maik Fischer Date: Sat, 28 Oct 2017 12:36:57 +0200 Subject: [PATCH] credit_manager: use strncpy --- src/credit_manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/credit_manager.c b/src/credit_manager.c index 6dbae85..1f569f7 100644 --- a/src/credit_manager.c +++ b/src/credit_manager.c @@ -129,7 +129,8 @@ static void delete_credit(void) { if (credits.num_items > 1) { /* Swap last item with this one and delete the last one to avoid holes */ last = (credits.num_items - 1); - strcpy(credits.credits[num].nickname, credits.credits[last].nickname); + strncpy(credits.credits[num].nickname, credits.credits[last].nickname, + NICKNAME_MAX_LEN); credits.credits[num].credit = credits.credits[last].credit; _delete_credit(last); } else { -- 2.39.5