summaryrefslogtreecommitdiffstats
path: root/pw/pw_group.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2013-06-19 11:36:13 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2013-06-19 11:36:13 +0000
commit92ca6ea990f50c4c8bd3c485bcb54646a590f0ba (patch)
treefd105835d2f614bac3c24fd429fa3bea8f98ef8c /pw/pw_group.c
parent1d39c9328d1f55897e016da0574741cf289c9424 (diff)
parent6e958ef1b49b6a86d2c9a1fd68f98f9e84842aaa (diff)
downloadpw-darwin-92ca6ea990f50c4c8bd3c485bcb54646a590f0ba.tar.gz
pw-darwin-92ca6ea990f50c4c8bd3c485bcb54646a590f0ba.tar.zst
pw-darwin-92ca6ea990f50c4c8bd3c485bcb54646a590f0ba.zip
Merge fresh head.
Diffstat (limited to 'pw/pw_group.c')
-rw-r--r--pw/pw_group.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pw/pw_group.c b/pw/pw_group.c
index a8f182c..3259412 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"
@@ -272,8 +274,7 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args)
pw_log(cnf, mode, W_GROUP, "%s(%ld)", grp->gr_name, (long) grp->gr_gid);
- if (members)
- free(members);
+ free(members);
return EXIT_SUCCESS;
}
@@ -403,11 +404,10 @@ static int
print_group(struct group * grp, int pretty)
{
if (!pretty) {
- int buflen = 0;
char *buf = NULL;
- fmtgrent(&buf, &buflen, grp);
- fputs(buf, stdout);
+ buf = gr_make(grp);
+ printf("%s\n", buf);
free(buf);
} else {
int i;