From 24e2d04c68845e25319fba10200ef50caac9b416 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Fri, 9 Feb 2024 22:07:49 +0100 Subject: [PATCH] motherfucking strncpy --- modfetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modfetch.c b/modfetch.c index 5a481e1..f913e52 100644 --- a/modfetch.c +++ b/modfetch.c @@ -60,10 +60,10 @@ char *remove_whitespaces(const char *str) { i += 1; j += 1; } - tmp[j] = '\0'; char *ret = malloc(j * sizeof(char)); strncpy(ret, tmp, j); + ret[j] = '\0'; return ret; }