openbsd-ports/net/argus/patches/patch-common_argus_util_c
2012-07-08 19:20:58 +00:00

21 lines
749 B
Plaintext

$OpenBSD: patch-common_argus_util_c,v 1.3 2012/07/08 19:20:58 steven Exp $
work around reading the wrong piece of memory on sparc64.
--- common/argus_util.c.orig Thu Mar 15 06:13:08 2012
+++ common/argus_util.c Wed Jun 27 22:25:19 2012
@@ -2084,11 +2084,12 @@ print_time(struct timeval *tvp)
char timeZoneBuf[32];
char *retn = ArgusPrintTimeBuf, *ptr;
struct tm *tm, tmbuf;
+ time_t sec = (time_t) tvp->tv_sec;
bzero (timeZoneBuf, sizeof(timeZoneBuf));
bzero (ArgusPrintTimeBuf, sizeof(ArgusPrintTimeBuf));
- if ((tm = localtime_r ((time_t *)&tvp->tv_sec, &tmbuf)) != NULL) {
+ if ((tm = localtime_r (&sec, &tmbuf)) != NULL) {
#if !defined(HAVE_STRFTIME)
snprintf (retn, 32, "%9d", (int) tvp->tv_sec);
#else