]> git.sur5r.net Git - c128-kasse/commitdiff
credit_manager: use strncpy
authorMaik Fischer <maikf@qu.cx>
Sat, 28 Oct 2017 10:36:57 +0000 (12:36 +0200)
committerMaik Fischer <maikf@qu.cx>
Mon, 30 Oct 2017 10:10:51 +0000 (11:10 +0100)
src/credit_manager.c

index 6dbae85d23fa48fa5f49a32a7a551e1b8b704dc2..1f569f7b693843e6e0373fbecb1516bde2adeab0 100644 (file)
@@ -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 {