units(1): use common functions
No need to replicate strdup
This commit is contained in:
parent
0c50edff52
commit
cfa8c23640
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user