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

Have timestr() return "never" text.dat string when passed 0

like datestr() does.
parent d55686a5
No related branches found
No related tags found
No related merge requests found
Pipeline #7708 failed
......@@ -261,6 +261,10 @@ char* timestr(scfg_t* cfg, time32_t t, char* str)
char** w = (cfg->text == NULL) ? (char**)wday : &cfg->text[Sun];
char** m = (cfg->text == NULL) ? (char**)mon : &cfg->text[Jan];
if(t == 0) {
strcpy(str, cfg->text == NULL ? "Never" : cfg->text[Never]);
return str;
}
if(localtime_r(&intime,&tm)==NULL) {
strcpy(str,"Invalid Time");
return(str);
......
......@@ -91,7 +91,7 @@ void sbbs_t::showfileinfo(file_t* f, bool show_extdesc)
bprintf(P_TRUNCATE, text[FiDateUled],timestr(f->hdr.when_imported.time));
if(getfiletime(&cfg, f) > 0)
bprintf(P_TRUNCATE, text[FiFileDate],timestr(f->time));
bprintf(P_TRUNCATE, text[FiDateDled],f->hdr.last_downloaded ? timestr(f->hdr.last_downloaded) : "Never");
bprintf(P_TRUNCATE, text[FiDateDled], timestr(f->hdr.last_downloaded));
bprintf(P_TRUNCATE, text[FiTimesDled],f->hdr.times_downloaded);
ulong timetodl = gettimetodl(&cfg, f, cur_cps);
if(timetodl > 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