pkgsrc/net/flow-tools/patches/patch-as
sbd 9f542e38a7 Always use time_t as the argument to ctime().
On systems where time_t is 64 bit supplying a 32 bit integer to ctime()
may cause problems.

Bump PKGREVISION
2013-10-13 21:52:44 +00:00

56 lines
1.5 KiB
Text

$NetBSD: patch-as,v 1.2 2013/10/13 21:52:44 sbd Exp $
--- lib/ftio.c.orig 2003-02-24 00:51:47.000000000 +0000
+++ lib/ftio.c
@@ -1605,6 +1605,7 @@ void ftio_header_print(struct ftio *ftio
u_int32 flags, fields;
u_long period;
int n, streaming2;
+ time_t time_tmp;
fth = &ftio->fth;
@@ -1639,17 +1640,21 @@ void ftio_header_print(struct ftio *ftio
}
if (!streaming2)
- if (fields & FT_FIELD_CAP_START)
+ if (fields & FT_FIELD_CAP_START) {
+ time_tmp = fth->cap_start;
fprintf(std, "%c capture start: %s", cc,
- ctime((time_t*)&fth->cap_start));
+ ctime(&time_tmp));
+ }
if (!streaming2) {
if ((flags & FT_HEADER_FLAG_DONE) || (flags & FT_HEADER_FLAG_PRELOADED)) {
- if (fields & FT_FIELD_CAP_END)
+ if (fields & FT_FIELD_CAP_END) {
+ time_tmp = fth->cap_end;
fprintf(std, "%c capture end: %s", cc,
- ctime((time_t*)&fth->cap_end));
+ ctime(&time_tmp));
+ }
period = fth->cap_end - fth->cap_start;
if ((fields & FT_FIELD_CAP_END) && (fields & FT_FIELD_CAP_START))
@@ -2267,7 +2272,7 @@ int readn(register int fd, register void
break;
nleft -= nread;
- (char*)ptr += nread;
+ ptr = (char*)ptr + nread;
}
return (nbytes - nleft);
} /* readn */
@@ -2292,7 +2297,7 @@ int writen(register int fd, register voi
return(nwritten); /* error */
nleft -= nwritten;
- (char*)ptr += nwritten;
+ ptr = (char*)ptr + nwritten;
}
return(nbytes - nleft);
} /* writen */