fix: strdup: add 1 to galloc for the \0
This commit is contained in:
parent
22c500564a
commit
a49499e78e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user