From d39d03f482e8bc3ef09011c1e334f1b5ddde9057 Mon Sep 17 00:00:00 2001 From: dqnk Date: Wed, 21 Jul 2021 17:10:56 +0200 Subject: [PATCH] updated truncate_name method --- uwufetch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/uwufetch.c b/uwufetch.c index d928f76..6842ab6 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -1008,8 +1008,11 @@ void uwu_name() void truncate_name(char *name) { - for (int i = target_width; i < 256; i++) - name[i] = '\0'; + char arr[target_width]; + + for (int i = 0; i < target_width; i++) + arr[i] = name[i]; + name = arr; } // remove square brackets (for gpu names)