diff options
author | eadler <eadler@FreeBSD.org> | 2014-05-12 05:44:55 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2014-05-12 05:44:55 +0000 |
commit | 6ef45d7151a097124bb96513ed7b125cf963782d (patch) | |
tree | 3f0f4a804b1fd4584e6d001d2d333c04fe6077da /usr.bin | |
parent | b031f87ca09e2d76dd70b8a845ca699761273def (diff) | |
download | FreeBSD-src-6ef45d7151a097124bb96513ed7b125cf963782d.zip FreeBSD-src-6ef45d7151a097124bb96513ed7b125cf963782d.tar.gz |
units(1): use common functions
No need to replicate strdup
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/units/units.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/units/units.c b/usr.bin/units/units.c index 70bd9ec..4691036 100644 --- a/usr.bin/units/units.c +++ b/usr.bin/units/units.c @@ -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); } |