diff options
| author | Baptiste Daroussin <bapt@FreeBSD.org> | 2012-10-30 08:00:53 +0000 |
|---|---|---|
| committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2012-10-30 08:00:53 +0000 |
| commit | 530ff00378e7fc235e5ea51067c77398d575141e (patch) | |
| tree | 3abb99e7579c92aa1f2dcc367f65dac3918dfad9 /pw/pw_group.c | |
| parent | 6844cbad609c7fe499b4e759a0157ae704c84ccc (diff) | |
| download | pw-darwin-530ff00378e7fc235e5ea51067c77398d575141e.tar.gz pw-darwin-530ff00378e7fc235e5ea51067c77398d575141e.zip | |
Teach pw(8) about how to use pw/gr API to reduce code duplication
MFC after: 2 months
Diffstat (limited to 'pw/pw_group.c')
| -rw-r--r-- | pw/pw_group.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pw/pw_group.c b/pw/pw_group.c index a8f182c..f4f2116 100644 --- a/pw/pw_group.c +++ b/pw/pw_group.c @@ -34,6 +34,8 @@ static const char rcsid[] = #include <termios.h> #include <stdbool.h> #include <unistd.h> +#include <grp.h> +#include <libutil.h> #include "pw.h" #include "bitmap.h" @@ -403,10 +405,9 @@ static int print_group(struct group * grp, int pretty) { if (!pretty) { - int buflen = 0; char *buf = NULL; - fmtgrent(&buf, &buflen, grp); + buf = gr_make(grp); fputs(buf, stdout); free(buf); } else { |
