Skip to content
Snippets Groups Projects
Commit 206134e2 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use new C++ wrapper for unixtodstr()

Fix new date editing bug in user editor: we must use the numeric format
for dates when creating strings to be edited.
parent b5caa291
No related branches found
No related tags found
No related merge requests found
Pipeline #6977 passed
......@@ -143,8 +143,8 @@ void sbbs_t::nodesync(bool clearline)
if(!(sys_status&SS_NEWDAY)) {
now=time(NULL);
unixtodstr(&cfg,(time32_t)logontime,str);
unixtodstr(&cfg,(time32_t)now,today);
unixtodstr(logontime,str);
unixtodstr(now,today);
if(strcmp(str,today)) { /* New day, clear "today" user vars */
sys_status|=SS_NEWDAY; // So we don't keep doing this over&over
resetdailyuserdat(&cfg, &useron,/* write: */true);
......
......@@ -187,7 +187,7 @@ void sbbs_t::update_qwkroute(char *via)
for(i=0;i<total_qwknodes;i++)
if(qwknode[i].time>t)
fprintf(stream,"%s %s:%s\r\n"
,unixtodstr(&cfg,(time32_t)qwknode[i].time,str),qwknode[i].id,qwknode[i].path);
,unixtodstr(qwknode[i].time,str),qwknode[i].id,qwknode[i].path);
fclose(stream);
}
else
......
......@@ -73,8 +73,8 @@ void sbbs_t::useredit(int usernumber)
return;
}
}
unixtodstr(&cfg,time32(NULL),str);
unixtodstr(&cfg,user.laston,tmp);
unixtodstr(time(NULL),str);
unixtodstr(user.laston,tmp);
if(strcmp(str,tmp) && user.ltoday) {
user.ltoday=user.ttoday=user.ptoday=user.etoday=user.textra=0;
user.freecdt=cfg.level_freecdtperday[user.level];
......@@ -341,28 +341,28 @@ void sbbs_t::useredit(int usernumber)
break;
case 'K': /* date changes */
bputs(text[UeditLastOn]);
datestr(user.laston,str);
unixtodstr(user.laston,str);
gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT);
if(sys_status&SS_ABORT)
break;
user.laston=dstrtounix(&cfg,str);
putuserdatetime(user.number, USER_LASTON, user.laston);
bputs(text[UeditFirstOn]);
datestr(user.firston,str);
unixtodstr(user.firston,str);
gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT);
if(sys_status&SS_ABORT)
break;
user.firston=dstrtounix(&cfg,str);
putuserdatetime(user.number, USER_FIRSTON, user.firston);
bputs(text[UeditExpire]);
datestr(user.expire,str);
unixtodstr(user.expire,str);
gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT);
if(sys_status&SS_ABORT)
break;
user.expire=dstrtounix(&cfg,str);
putuserdatetime(user.number, USER_EXPIRE, user.expire);
bputs(text[UeditPwModDate]);
datestr(user.pwmod,str);
unixtodstr(user.pwmod,str);
gettmplt(str, date_template(&cfg, tmp, sizeof tmp),K_LINE|K_EDIT);
if(sys_status&SS_ABORT)
break;
......
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