From 1ab8e21741c53e8f3cfe1358e2ba708c254b57d9 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sat, 10 Jan 2009 08:26:56 +0000
Subject: [PATCH] Bug-fix in getage() for users born after 1999 (Eliza's the
 first?).

---
 src/sbbs3/userdat.c | 8 ++++----
 src/sbbs3/userdat.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/sbbs3/userdat.c b/src/sbbs3/userdat.c
index 5ed42f3a14..ee7e8d941c 100644
--- a/src/sbbs3/userdat.c
+++ b/src/sbbs3/userdat.c
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -625,9 +625,9 @@ int DLLCALL putusername(scfg_t* cfg, int number, char *name)
 /****************************************************************************/
 /* Returns the age derived from the string 'birth' in the format MM/DD/YY	*/
 /****************************************************************************/
-char DLLCALL getage(scfg_t* cfg, char *birth)
+uint DLLCALL getage(scfg_t* cfg, char *birth)
 {
-	char	age;
+	uint	age;
 	struct	tm tm;
 	time_t	now;
 
@@ -642,7 +642,7 @@ char DLLCALL getage(scfg_t* cfg, char *birth)
 		return(0);
 	age=(tm.tm_year)-(((birth[6]&0xf)*10)+(birth[7]&0xf));
 	if(age>105)
-		age-=105;
+		age-=100;
 	tm.tm_mon++;	/* convert to 1 based */
 	if(cfg->sys_misc&SM_EURODATE) {		/* DD/MM/YY format */
 		if(atoi(birth)>31 || atoi(birth+3)>12)
diff --git a/src/sbbs3/userdat.h b/src/sbbs3/userdat.h
index 7058fb1518..f8e7338631 100644
--- a/src/sbbs3/userdat.h
+++ b/src/sbbs3/userdat.h
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -80,7 +80,7 @@ DLLEXPORT int	DLLCALL putusername(scfg_t* cfg, int number, char * name);
 DLLEXPORT uint	DLLCALL total_users(scfg_t* cfg);
 DLLEXPORT uint	DLLCALL lastuser(scfg_t* cfg);
 DLLEXPORT BOOL	DLLCALL del_lastuser(scfg_t* cfg);
-DLLEXPORT char	DLLCALL getage(scfg_t* cfg, char *birthdate);
+DLLEXPORT uint	DLLCALL getage(scfg_t* cfg, char *birthdate);
 DLLEXPORT char*	DLLCALL username(scfg_t* cfg, int usernumber, char * str);
 DLLEXPORT char* DLLCALL usermailaddr(scfg_t* cfg, char* addr, char* name);
 DLLEXPORT int	DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, int* file);
-- 
GitLab