Skip to content
Snippets Groups Projects
Commit afc1fdf6 authored by Clara Daia Hilgenberg Daru's avatar Clara Daia Hilgenberg Daru
Browse files

Replace undesired exit with "return NULL"

Conflicts:
	.gitignore
parent 54cf6129
No related branches found
No related tags found
1 merge request!51Merge development to master
......@@ -294,7 +294,7 @@ static struct user_log * last_modified () {
if (x == ENOENT)
fprintf(stderr, "Perhaps this file was removed by the "
"operator to prevent logging info.\n");
exit(1);
return NULL;
}
/*
......@@ -425,7 +425,8 @@ static struct user_log * last_modified () {
break;
if ((p = (struct utmplist *)malloc(sizeof(struct utmplist))) == NULL) {
fprintf(stderr, "ERROR: out of memory\n");
exit(1);
return NULL;
}
memcpy(&p->ut, &ut, sizeof(struct utmp));
p->next = utmplist;
......@@ -542,7 +543,7 @@ static struct user_log * last_modified () {
break;
if ((p = (struct utmplist *)malloc(sizeof(struct utmplist))) == NULL) {
fprintf(stderr, "ERROR: out of memory\n");
exit(1);
return NULL;
}
memcpy(&p->ut, &ut, sizeof(struct utmp));
p->next = utmplist;
......@@ -575,7 +576,7 @@ int get_user_count () {
strftime (yesterday,7,"%y%m%d",timeinfo);
yesterday[6] = '\0';
for(i = u; i; i = u){
if(!strcmp(i->logout,"999999")){
if(strcmp(i->login,yesterday) <= 0){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment