From b6b4b742d3390d296b368763bbcc7ee1d231481a Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Fri, 28 Nov 2025 13:09:50 -0300 Subject: [PATCH] fix bug in str_init --- src/plugins/strings/strings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/strings/strings.c b/src/plugins/strings/strings.c index c16a67a..6e7a0da 100644 --- a/src/plugins/strings/strings.c +++ b/src/plugins/strings/strings.c @@ -10,7 +10,7 @@ void str_init(char* str, int n) // could also use for (int i = 0; i < n; i++) str[i] = ' '; - str[n] = '\0'; + str[n-1] = '\0'; } int str_replace_start(const char* string, const char* target, const char* replacement, char* output) {