units(1): use common functions

No need to replicate strdup
This commit is contained in:
Eitan Adler 2014-05-12 05:44:55 +00:00
parent 0c50edff52
commit cfa8c23640

View File

@ -111,10 +111,9 @@ dupstr(const char *str)
{
char *ret;
ret = malloc(strlen(str) + 1);
ret = strdup(str);
if (!ret)
errx(3, "memory allocation error");
strcpy(ret, str);
err(3, "dupstr");
return (ret);
}