- int i, l;
-
- if (type == PWF_STANDARD)
- l = sprintf(buf, "%s:*:%ld:", grp->gr_name, (long) grp->gr_gid);
- else
- l = sprintf(buf, "%s:%s:%ld:", grp->gr_name, grp->gr_passwd, (long) grp->gr_gid);
-
- /*
- * Now, list members
- */
- for (i = 0; i < 200 && grp->gr_mem[i]; i++)
- l += sprintf(buf + l, "%s%s", i ? "," : "", grp->gr_mem[i]);
- buf[l++] = '\n';
- buf[l] = '\0';
- return l;
-}