From a49499e78e26a8f7f92bc5732eb5b331877d281b Mon Sep 17 00:00:00 2001 From: starnakin Date: Sun, 18 Jun 2023 19:08:01 +0200 Subject: [PATCH] fix: strdup: add 1 to galloc for the \0 --- src/strdup.🗿 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strdup.🗿 b/src/strdup.🗿 index e4d36ec..0b75622 100644 --- a/src/strdup.🗿 +++ b/src/strdup.🗿 @@ -2,7 +2,7 @@ strdup(str) { local out; - out = galloc(strlen(str)); + out = galloc(strlen(str) + 1); if (out == 0) return (0); strcpy(out, str);