Skip to content

Commit

Permalink
lib/, src/: Remove unnecessary variables
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Colomar <[email protected]>
  • Loading branch information
alejandro-colomar committed Jan 2, 2025
1 parent 14b995b commit d8ac495
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
8 changes: 2 additions & 6 deletions lib/getdef.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,9 @@ static /*@observer@*/ /*@null@*/struct itemdef *def_find (const char *name, cons
void setdef_config_file (const char* file)
{
#ifdef USE_ECONF
char *cp;

cp = xaprintf("%s/%s", file, sysconfdir);
sysconfdir = cp;
sysconfdir = xaprintf("%s/%s", file, sysconfdir);
#ifdef VENDORDIR
cp = xaprintf("%s/%s", file, vendordir);
vendordir = cp;
vendordir = xaprintf("%s/%s", file, vendordir);
#endif
#else
def_fname = file;
Expand Down
5 changes: 1 addition & 4 deletions src/su.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,15 +1204,12 @@ int main (int argc, char **argv)
* case they will be provided to the new user's shell as arguments.
*/
if (fakelogin) {
char *arg0;

cp = getdef_str ("SU_NAME");
if (NULL == cp) {
cp = Basename (shellstr);
}

arg0 = xaprintf("-%s", cp);
cp = arg0;
cp = xaprintf("-%s", cp);
} else {
cp = Basename (shellstr);
}
Expand Down
10 changes: 3 additions & 7 deletions src/useradd.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,10 @@ get_defaults(void)
if (streq(ccp, ""))
ccp = SKEL_DIR;

if (prefix[0]) {
char *dt;

dt = xaprintf("%s/%s", prefix, ccp);
def_template = dt;
} else {
if (prefix[0])
def_template = xaprintf("%s/%s", prefix, ccp);
else
def_template = xstrdup(ccp);
}
}

/*
Expand Down
5 changes: 1 addition & 4 deletions src/usermod.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,15 +427,12 @@ usage (int status)
static char *new_pw_passwd (char *pw_pass)
{
if (Lflg && ('!' != pw_pass[0])) {
char *buf;

#ifdef WITH_AUDIT
audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
"updating passwd", user_newname, user_newid, 0);
#endif
SYSLOG ((LOG_INFO, "lock user '%s' password", user_newname));
buf = xaprintf("!%s", pw_pass);
pw_pass = buf;
pw_pass = xaprintf("!%s", pw_pass);
} else if (Uflg && pw_pass[0] == '!') {
if (pw_pass[1] == '\0') {
fprintf (stderr,
Expand Down

0 comments on commit d8ac495

Please sign in to comment.