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

Fix bug with parse_birthdate() in year-first format

The year is 4 digits, so the offsets aren't the same as the other 2 supported
formats. Doh!

Thanks Max for testing!
parent 43a2a366
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -1014,7 +1014,7 @@ int getage(scfg_t* cfg, const char *birth)
char* parse_birthdate(scfg_t* cfg, const char* birthdate, char* out, size_t maxlen)
{
if (cfg->sys_date_fmt == YYMMDD)
safe_snprintf(out, maxlen, "%.4s%.2s%.2s", birthdate, birthdate + 3, birthdate + 6);
safe_snprintf(out, maxlen, "%.4s%.2s%.2s", birthdate, birthdate + 5, birthdate + 8);
else if (cfg->sys_date_fmt == DDMMYY)
safe_snprintf(out, maxlen, "%.4s%.2s%.2s", birthdate + 6, birthdate + 3, birthdate);
else
......
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