summaryrefslogtreecommitdiffstats
path: root/chpass/util.c
diff options
context:
space:
mode:
authorDaniel O'Callaghan <danny@FreeBSD.org>1999-01-18 22:15:09 +0000
committerDaniel O'Callaghan <danny@FreeBSD.org>1999-01-18 22:15:09 +0000
commit49800698c8a29ccb35c04022d63b4f4e62b9bb6b (patch)
tree27a1437222fb760b7e23451a532b7e52bf5797b9 /chpass/util.c
parentd8243ec3c8fec805425e327a19995a97a69018a9 (diff)
downloadpw-darwin-49800698c8a29ccb35c04022d63b4f4e62b9bb6b.tar.gz
pw-darwin-49800698c8a29ccb35c04022d63b4f4e62b9bb6b.tar.zst
pw-darwin-49800698c8a29ccb35c04022d63b4f4e62b9bb6b.zip
Allow two digit years 1969-2068
Diffstat (limited to 'chpass/util.c')
-rw-r--r--chpass/util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/chpass/util.c b/chpass/util.c
index 132c151..d8917f5 100644
--- a/chpass/util.c
+++ b/chpass/util.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)util.c 8.4 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: util.c,v 1.6 1998/03/23 07:41:49 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -115,9 +115,12 @@ atot(p, store)
year = atoi(t);
if (day < 1 || day > 31 || month < 1 || month > 12 || !year)
goto bad;
- if (year < 100)
+ /* Allow two digit years 1969-2068 */
+ if (year < 69)
+ year += 2000;
+ else if (year < 100)
year += 1900;
- if (year <= 1970)
+ if (year < 1969)
bad: return (1);
lt->tm_year = year - 1900;
lt->tm_mon = month - 1;