From 89f297dfd42b4b42a7e532129bcade65a035d263 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Wed, 21 Jan 2009 20:15:34 +0100 Subject: [PATCH] Bring in some fixes from tzdata2009a from elsie. * strftime.c - c format warning fix * zdump.c - fix infinite loop caused by overflow/optimization interaction --- lib/libc/stdtime/strftime.c | 4 ++-- usr.sbin/zic/zdump.c | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c index 7c8834a8bc..455dbd3a4f 100644 --- a/lib/libc/stdtime/strftime.c +++ b/lib/libc/stdtime/strftime.c @@ -1,5 +1,5 @@ /* - * @(#)strftime.c 8.2 + * @(#)strftime.c 8.3 * $NetBSD: src/lib/libc/time/strftime.c,v 1.16 2004/05/12 23:03:11 kleink Exp $ * $DragonFly: src/lib/libc/stdtime/strftime.c,v 1.7 2008/10/19 20:15:58 swildner Exp $ */ @@ -163,7 +163,7 @@ label: { int warn2 = IN_SOME; - pt = _fmt(Locale->d_t_fmt, t, pt, ptlim, warnp); + pt = _fmt(Locale->d_t_fmt, t, pt, ptlim, &warn2); if (warn2 == IN_ALL) warn2 = IN_THIS; if (warn2 > *warnp) diff --git a/usr.sbin/zic/zdump.c b/usr.sbin/zic/zdump.c index 1374b7cc46..6a6ef4c839 100644 --- a/usr.sbin/zic/zdump.c +++ b/usr.sbin/zic/zdump.c @@ -1,5 +1,5 @@ /* - * @(#)zdump.c 8.6 + * @(#)zdump.c 8.8 * $FreeBSD: src/usr.sbin/zic/zdump.c,v 1.7 1999/08/28 01:21:19 peter Exp $ * $DragonFly: src/usr.sbin/zic/zdump.c,v 1.5 2008/10/19 20:15:58 swildner Exp $ */ @@ -313,13 +313,9 @@ main(int argc, char *argv[]) strncpy(buf, abbr(&tm), (sizeof buf) - 1); } for ( ; ; ) { - if (t >= cuthitime) + if (t >= cuthitime || t >= cuthitime - SECSPERHOUR * 12) break; newt = t + SECSPERHOUR * 12; - if (newt >= cuthitime) - break; - if (newt <= t) - break; newtmp = localtime(&newt); if (newtmp != NULL) newtm = *newtmp; @@ -399,7 +395,7 @@ _("use of -v on system with floating time_t other than float or double\n")); static void usage(void) { - fprintf(stderr, _("usage: zdump [-v] [-c cutoff] zonename ...\n")); + fprintf(stderr, _("usage: zdump [-v] [-c [loyear,]hiyear] zonename ...\n")); exit(EXIT_FAILURE); } -- 2.11.4.GIT