Skip to content
Snippets Groups Projects
Commit 37ba19b4 authored by deuce's avatar deuce
Browse files

Remove unneeded time_t conversions

parent 70e268b5
No related branches found
No related tags found
No related merge requests found
......@@ -221,7 +221,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
SAVELINE;
attr(LIGHTGRAY);
now=time(NULL);
bprintf(text[TiLogon],time32str(&logontime));
bprintf(text[TiLogon],timestr(&logontime));
bprintf(text[TiNow],timestr(&now));
bprintf(text[TiTimeon]
,sectostr(now-logontime,tmp));
......
......@@ -228,13 +228,11 @@ void sbbs_t::logofflist()
{
char str[256];
int file;
time_t tmptime;
struct tm tm, tm_now;
if(localtime_r(&now,&tm_now)==NULL)
return;
tmptime=logontime;
if(localtime_r(&tmptime,&tm)==NULL)
if(localtime_r(&logontime,&tm)==NULL)
return;
sprintf(str,"%slogs/%2.2d%2.2d%2.2d.lol",cfg.logs_dir,tm.tm_mon+1,tm.tm_mday
,TM_YEAR(tm.tm_year));
......
......@@ -307,7 +307,6 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
struct tm tm;
struct tm tl;
stats_t stats;
time_t tmptime;
char node_dir[MAX_PATH+1];
char ctrl_dir[MAX_PATH+1];
......@@ -625,8 +624,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
lfexpand(str,misc);
write(file,str,strlen(str));
tmptime=logontime;
localtime_r(&tmptime,&tm);
localtime_r(&logontime,&tm);
localtime_r(&useron.laston,&tl);
sprintf(str,"%02d:%02d\n%02d:%02d\n%u\n%u\n%lu\n"
"%lu\n%s\n%u\n%u\n"
......@@ -788,8 +786,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
write(file,&c,1); /* NetMailEntered */
write(file,&c,1); /* EchoMailEntered */
tmptime=logontime;
localtime_r(&tmptime,&tm);
localtime_r(&logontime,&tm);
sprintf(tmp,"%02d:%02d",tm.tm_hour,tm.tm_min);
str2pas(tmp,str);
write(file,str,6); /* LoginTime */
......@@ -978,8 +975,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
,useron.pass); /* User's password */
write(file,str,27);
tmptime=logontime;
if(localtime_r(&tmptime,&tm)==NULL)
if(localtime_r(&logontime,&tm)==NULL)
i=0;
else
i=(tm.tm_hour*60)+tm.tm_min;
......@@ -1178,8 +1174,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
lfexpand(str,misc);
write(file,str,strlen(str));
tmptime=logontime;
if(localtime_r(&tmptime,&tm)==NULL)
if(localtime_r(&logontime,&tm)==NULL)
l=0;
else
l=((((long)tm.tm_hour*60L)+(long)tm.tm_min)*60L)
......
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