From 13a381c980b14ddb6b141b14205631f7887432f9 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Mon, 1 Jan 2024 16:11:40 -0800
Subject: [PATCH] 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!
---
 src/sbbs3/userdat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sbbs3/userdat.c b/src/sbbs3/userdat.c
index c1aad034d7..2c7d327a34 100644
--- a/src/sbbs3/userdat.c
+++ b/src/sbbs3/userdat.c
@@ -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
-- 
GitLab