add: strdup

This commit is contained in:
2023-06-18 18:48:08 +02:00
parent d0f4398f78
commit 22c500564a
2 changed files with 24 additions and 0 deletions

10
src/strdup.🗿 Normal file
View File

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