diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-03-30 06:59:50 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-03-30 06:59:50 +0000 |
commit | 23ed975a6d5eb145159abb55333c86cab3c5ae3a (patch) | |
tree | 9fe964ef17f07826448a5cad129689a9d2a62c17 /usr.bin/make | |
parent | 69b3602370538d6a76b8ade41a7ae12939613759 (diff) |
Y2K fixes from Andreas.Gunnarsson@emw.ericsson.se; culled from various places
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/targ.c | 16 | ||||
-rw-r--r-- | usr.bin/make/var.c | 5 |
2 files changed, 7 insertions, 14 deletions
diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index bf705b9fded..1549927f920 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $OpenBSD: targ.c,v 1.7 1997/04/28 01:52:42 millert Exp $ */ +/* $OpenBSD: targ.c,v 1.8 1998/03/30 06:59:38 deraadt Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else -static char *rcsid = "$OpenBSD: targ.c,v 1.7 1997/04/28 01:52:42 millert Exp $"; +static char *rcsid = "$OpenBSD: targ.c,v 1.8 1998/03/30 06:59:38 deraadt Exp $"; #endif #endif /* not lint */ @@ -467,17 +467,11 @@ Targ_FmtTime (time) time_t time; { struct tm *parts; - static char buf[40]; - static char *months[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; + static char buf[128]; parts = localtime(&time); - - sprintf (buf, "%d:%02d:%02d %s %d, %d", - parts->tm_hour, parts->tm_min, parts->tm_sec, - months[parts->tm_mon], parts->tm_mday, 1900 + parts->tm_year); + strftime(buf, sizeof buf, "%k:%M:%S %b %d, %Y", parts); + buf[sizeof(buf) - 1] = '\0'; return(buf); } diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 93ec75192b9..4ab4cd1eda1 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,4 +1,4 @@ -/* $OpenBSD: var.c,v 1.7 1997/12/18 21:50:45 deraadt Exp $ */ +/* $OpenBSD: var.c,v 1.8 1998/03/30 06:59:39 deraadt Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: var.c,v 1.7 1997/12/18 21:50:45 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: var.c,v 1.8 1998/03/30 06:59:39 deraadt Exp $"; #endif #endif /* not lint */ @@ -1150,7 +1150,6 @@ VarRESubstitute(word, addSpace, buf, patternp) else if ((*rp == '&') || ((*rp == '\\') && isdigit(rp[1]))) { int n; char *subbuf; - char zsub; int sublen; char errstr[3]; |