diff options
Diffstat (limited to 'usr.sbin/pw')
-rw-r--r-- | usr.sbin/pw/grupd.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.sbin/pw/grupd.c b/usr.sbin/pw/grupd.c index e9f6b5e..3f78e95 100644 --- a/usr.sbin/pw/grupd.c +++ b/usr.sbin/pw/grupd.c @@ -50,12 +50,11 @@ setgrdir(const char * dir) { if (dir == NULL) return -1; - else { - char * d = malloc(strlen(dir)+1); - if (d == NULL) - return -1; - grpath = strcpy(d, dir); - } + else + grpath = strdup(dir); + if (grpath == NULL) + return -1; + return 0; } |