From 7184d24a07df16085b560f362e87bc9c9ec5004f Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sun, 7 Jun 2015 10:57:02 +0000 Subject: Instead of always casting the pw_checkname input to u_char * and casting it back to char *, change pw_checkname to directly take char * in input --- pw/pw_group.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pw/pw_group.c') diff --git a/pw/pw_group.c b/pw/pw_group.c index c001160..bc559a5 100644 --- a/pw/pw_group.c +++ b/pw/pw_group.c @@ -146,7 +146,7 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args) grp->gr_gid = (gid_t) atoi(a_gid->val); if (a_newname != NULL) - grp->gr_name = pw_checkname((u_char *)a_newname->val, 0); + grp->gr_name = pw_checkname(a_newname->val, 0); } else { if (a_name == NULL) /* Required */ errx(EX_DATAERR, "group name required"); @@ -156,7 +156,7 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args) extendarray(&members, &grmembers, 200); members[0] = NULL; grp = &fakegroup; - grp->gr_name = pw_checkname((u_char *)a_name->val, 0); + grp->gr_name = pw_checkname(a_name->val, 0); grp->gr_passwd = "*"; grp->gr_gid = gr_gidpolicy(cnf, args); grp->gr_mem = members; -- cgit v1.2.3