Change ut_list_p variable from global to local

The variable ut_list_p, is used in two seperate functions, read_wtmp()
and free_wtmp(), it's state isn't preserved, nor is it important,
therefore it's cleaner to simply use two local variables in each
function, rather than one global variable, used across both.
This commit is contained in:
Petar Kapris 2020-11-25 19:04:56 +01:00
parent 37f91bf330
commit e4c67052ef

View file

@ -165,7 +165,6 @@ struct ut_list {
};
struct ut_list *wtmplist = (struct ut_list *) NULL;
struct ut_list *ut_list_p;
struct time_ent {
int days;
@ -388,6 +387,7 @@ void read_wtmp()
{
FILE *fp;
struct utmp ut;
struct ut_list *ut_list_p;
struct tm *tm;
#ifdef DEBUG
@ -445,6 +445,7 @@ void read_wtmp()
void free_wtmp()
{
struct ut_list *ut_list_p;
#ifdef DEBUG
openlog("timeoutd", OPENLOG_FLAGS, LOG_DAEMON);
syslog(SYSLOG_DEBUG, "Freeing list of today's wtmp entries.");