Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/usr.sbin/syslogd Pull up following revision(s) (requested...
details: https://anonhg.NetBSD.org/src/rev/b693e46f4138
branches: netbsd-7
changeset: 800325:b693e46f4138
user: snj <snj%NetBSD.org@localhost>
date: Mon Sep 04 06:30:38 2017 +0000
description:
Pull up following revision(s) (requested by ginsbach in ticket #1496):
usr.sbin/syslogd/syslogd.c: revision 1.123
PR/51234: Onno van der Linden: syslogd sometimes incorrectly handles iso to
bsd time conversion
diffstat:
usr.sbin/syslogd/syslogd.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diffs (53 lines):
diff -r 1e63d8063061 -r b693e46f4138 usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c Mon Sep 04 06:21:45 2017 +0000
+++ b/usr.sbin/syslogd/syslogd.c Mon Sep 04 06:30:38 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syslogd.c,v 1.119.4.1 2015/05/13 19:19:19 snj Exp $ */
+/* $NetBSD: syslogd.c,v 1.119.4.2 2017/09/04 06:30:38 snj Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#else
-__RCSID("$NetBSD: syslogd.c,v 1.119.4.1 2015/05/13 19:19:19 snj Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.119.4.2 2017/09/04 06:30:38 snj Exp $");
#endif
#endif /* not lint */
@@ -1746,27 +1746,28 @@
struct tm parsed;
time_t timeval;
char tsbuf[MAX_TIMESTAMPLEN];
- int i = 0;
+ int i = 0, j;
DPRINTF(D_CALL, "check_timestamp(): convert ISO->BSD\n");
for(i = 0; i < MAX_TIMESTAMPLEN && from_buf[i] != '\0'
&& from_buf[i] != '.' && from_buf[i] != ' '; i++)
tsbuf[i] = from_buf[i]; /* copy date & time */
+ j = i;
for(; i < MAX_TIMESTAMPLEN && from_buf[i] != '\0'
&& from_buf[i] != '+' && from_buf[i] != '-'
&& from_buf[i] != 'Z' && from_buf[i] != ' '; i++)
; /* skip fraction digits */
for(; i < MAX_TIMESTAMPLEN && from_buf[i] != '\0'
- && from_buf[i] != ':' && from_buf[i] != ' ' ; i++)
- tsbuf[i] = from_buf[i]; /* copy TZ */
+ && from_buf[i] != ':' && from_buf[i] != ' ' ; i++, j++)
+ tsbuf[j] = from_buf[i]; /* copy TZ */
if (from_buf[i] == ':') i++; /* skip colon */
for(; i < MAX_TIMESTAMPLEN && from_buf[i] != '\0'
- && from_buf[i] != ' ' ; i++)
- tsbuf[i] = from_buf[i]; /* copy TZ */
+ && from_buf[i] != ' ' ; i++, j++)
+ tsbuf[j] = from_buf[i]; /* copy TZ */
(void)memset(&parsed, 0, sizeof(parsed));
+ (void)strptime(tsbuf, "%FT%T%z", &parsed);
parsed.tm_isdst = -1;
- (void)strptime(tsbuf, "%FT%T%z", &parsed);
timeval = mktime(&parsed);
*to_buf = strndup(make_timestamp(&timeval, false),
Home |
Main Index |
Thread Index |
Old Index