diff options
author | deraadt <> | 1996-06-10 06:19:33 +0000 |
---|---|---|
committer | deraadt <> | 1996-06-10 06:19:33 +0000 |
commit | 356d3bf1c9ce479f56c218896badf52348bae085 (patch) | |
tree | b18402f66aaca31936d914317db8cc0fbf1adcd6 | |
parent | 05d6250b2af2d52e77c8e68380342b511fa1b7fe (diff) | |
download | openbsd-356d3bf1c9ce479f56c218896badf52348bae085.tar.gz openbsd-356d3bf1c9ce479f56c218896badf52348bae085.tar.bz2 openbsd-356d3bf1c9ce479f56c218896badf52348bae085.zip |
fix %V
-rw-r--r-- | src/lib/libc/string/strftime.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libc/string/strftime.c b/src/lib/libc/string/strftime.c index b6326f274e..b1fa97cae1 100644 --- a/src/lib/libc/string/strftime.c +++ b/src/lib/libc/string/strftime.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: strftime.c,v 1.4 1996/03/25 21:17:36 tholo Exp $ */ | 1 | /* $OpenBSD: strftime.c,v 1.5 1996/06/10 06:19:33 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1989 The Regents of the University of California. | 4 | * Copyright (c) 1989 The Regents of the University of California. |
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | #if defined(LIBC_SCCS) && !defined(lint) | 36 | #if defined(LIBC_SCCS) && !defined(lint) |
37 | /*static char *sccsid = "from: @(#)strftime.c 5.11 (Berkeley) 2/24/91";*/ | 37 | /*static char *sccsid = "from: @(#)strftime.c 5.11 (Berkeley) 2/24/91";*/ |
38 | static char *rcsid = "$Id: strftime.c,v 1.4 1996/03/25 21:17:36 tholo Exp $"; | 38 | static char *rcsid = "$Id: strftime.c,v 1.5 1996/06/10 06:19:33 deraadt Exp $"; |
39 | #endif /* LIBC_SCCS and not lint */ | 39 | #endif /* LIBC_SCCS and not lint */ |
40 | 40 | ||
41 | #include <sys/localedef.h> | 41 | #include <sys/localedef.h> |
@@ -220,7 +220,11 @@ _fmt(format, t) | |||
220 | 220 | ||
221 | int week = MON_WEEK(t); | 221 | int week = MON_WEEK(t); |
222 | 222 | ||
223 | if (((t->tm_yday + 7 - (t->tm_wday + 1)) % 7) >= 4) { | 223 | int days = (((t)->tm_yday + 7 - \ |
224 | ((t)->tm_wday ? (t)->tm_wday - 1 : 6)) % 7); | ||
225 | |||
226 | |||
227 | if (days >= 4) { | ||
224 | week++; | 228 | week++; |
225 | } else if (week == 0) { | 229 | } else if (week == 0) { |
226 | week = 53; | 230 | week = 53; |