if (cc < sizeof(buf)) cc += snprintf(&buf[cc], sizeof(buf) - cc, "\n"); else err(EXIT_FAILURE, "group `%s' entry too long", grp->gr_name);
groupmod(int argc, char **argv){	struct group	*grp;	char		buf[LINE_MAX];	char		*newname;	char		**cpp;	int		dupgid;	int		gid;	int		cc;	int		c;	gid = -1;	dupgid = 0;	newname = NULL;	while ((c = getopt(argc, argv, "g:on:" GROUP_MOD_OPT_EXTENSIONS)) != -1) {		switch(c) {		case 'g':			if (!is_number(optarg)) {				errx(EXIT_FAILURE, "When using [-g gid], the gid must be numeric");			}			gid = atoi(optarg);			break;		case 'o':			dupgid = 1;			break;		case 'n':			memsave(&newname, optarg, strlen(optarg));			break;#ifdef EXTENSIONS		case 'v':			verbose = 1;			break;#endif		}	}	argc -= optind;	argv += optind;	if (argc != 1) {		usermgmt_usage("groupmod");	}	checkeuid();	if (gid < 0 && newname == NULL) {		err(EXIT_FAILURE, "Nothing to change");	}	if (dupgid && gid < 0) {		err(EXIT_FAILURE, "Duplicate which gid?");	}	if ((grp = getgrnam(*argv)) == NULL) {		err(EXIT_FAILURE, "can't find group `%s' to modify", *argv);	}	if (newname != NULL && !valid_group(newname)) {		warn("warning - invalid group name `%s'", newname);	}	cc = snprintf(buf, sizeof(buf), "%s:%s:%d:",			(newname) ? newname : grp->gr_name, grp->gr_passwd,			(gid < 0) ? grp->gr_gid : gid);	for (cpp = grp->gr_mem ; *cpp && cc < sizeof(buf) ; cpp++) {		cc += snprintf(&buf[cc], sizeof(buf) - cc, "%s%s", *cpp,			(cpp[1] == NULL) ? "" : ",");	}	if (cc < sizeof(buf))		cc += snprintf(&buf[cc], sizeof(buf) - cc, "\n");	else		err(EXIT_FAILURE, "group `%s' entry too long", grp->gr_name);	if (!modify_gid(*argv, buf))		err(EXIT_FAILURE, "can't change %s file", _PATH_GROUP);	return EXIT_SUCCESS;}