fix: strdup: add 1 to galloc for the \0

This commit is contained in:
starnakin 2023-06-18 19:08:01 +02:00
parent 22c500564a
commit a49499e78e

View File

@ -2,7 +2,7 @@ strdup(str)
{ {
local out; local out;
out = galloc(strlen(str)); out = galloc(strlen(str) + 1);
if (out == 0) if (out == 0)
return (0); return (0);
strcpy(out, str); strcpy(out, str);