From: Maik Fischer Date: Sat, 28 Oct 2017 10:36:57 +0000 (+0200) Subject: credit_manager: use strncpy X-Git-Tag: rgb2rv17~9^2~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1fffcc685e3073ec1aeccf03a5d48a3f501a1279;p=c128-kasse credit_manager: use strncpy --- 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 {