* src/groupmems.c: Use xstrdup() rather than strdup().

This commit is contained in:
nekral-guest 2008-07-27 22:30:22 +00:00
parent 717110d355
commit 5a0715fd6c
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2008-07-27 Nicolas François <nicolas.francois@centraliens.net>
* src/groupmems.c: Use xstrdup() rather than strdup().
2008-07-27 Nicolas François <nicolas.francois@centraliens.net> 2008-07-27 Nicolas François <nicolas.francois@centraliens.net>
* src/groupmems.c: Add parenthesis. * src/groupmems.c: Add parenthesis.

View File

@ -86,7 +86,7 @@ static char *whoami (void)
struct passwd *usr = getpwuid (getuid ()); struct passwd *usr = getpwuid (getuid ());
if (0 == strcmp (usr->pw_name, grp->gr_name)) { if (0 == strcmp (usr->pw_name, grp->gr_name)) {
return strdup (usr->pw_name); return xstrdup (usr->pw_name);
} else { } else {
return NULL; return NULL;
} }
@ -133,11 +133,11 @@ static void process_flags (int argc, char **argv)
&option_index)) != EOF) { &option_index)) != EOF) {
switch (arg) { switch (arg) {
case 'a': case 'a':
adduser = strdup (optarg); adduser = xstrdup (optarg);
++exclusive; ++exclusive;
break; break;
case 'd': case 'd':
deluser = strdup (optarg); deluser = xstrdup (optarg);
++exclusive; ++exclusive;
break; break;
case 'p': case 'p':
@ -145,7 +145,7 @@ static void process_flags (int argc, char **argv)
++exclusive; ++exclusive;
break; break;
case 'g': case 'g':
thisgroup = strdup (optarg); thisgroup = xstrdup (optarg);
break; break;
case 'l': case 'l':
list = true; list = true;