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

Fix extra char output from datestr() when given a time_t value of 0.

parent 196ad130
No related branches found
No related tags found
No related merge requests found
......@@ -152,23 +152,25 @@ char* unixtodstr(scfg_t* cfg, time32_t t, char *str)
}
/****************************************************************************/
/* Return 8-char numeric or verbal date */
/****************************************************************************/
char* datestr(scfg_t* cfg, time_t t, char* str)
{
if(t == 0)
return "---------";
return "--------";
if(!cfg->sys_date_verbal)
return unixtodstr(cfg, (time32_t)t, str);
return verbal_datestr(cfg, t, str);
}
/****************************************************************************/
/* return 8-char numeric date */
/****************************************************************************/
char* verbal_datestr(scfg_t* cfg, time_t t, char* str)
{
struct tm tm = {0};
if(localtime_r(&t, &tm) == NULL)
return "!!!!!!!!!";
return "!!!!!!!!";
char fmt[32] = "";
switch(cfg->sys_date_fmt) {
case MMDDYY:
......
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