1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
diff -Naur flow-tools-0.68.orig/lib/ftio.c flow-tools-0.68/lib/ftio.c
--- flow-tools-0.68.orig/lib/ftio.c 2007-05-15 18:56:54.000000000 +0000
+++ flow-tools-0.68/lib/ftio.c 2007-05-15 18:48:02.000000000 +0000
@@ -1605,6 +1605,7 @@
u_int32 flags, fields;
u_long period;
int n, streaming2;
+ time_t _ftime;
fth = &ftio->fth;
@@ -1639,17 +1640,21 @@
}
if (!streaming2)
- if (fields & FT_FIELD_CAP_START)
+ if (fields & FT_FIELD_CAP_START) {
+ _ftime = (time_t)fth->cap_start;
fprintf(std, "%c capture start: %s", cc,
- ctime((time_t*)&fth->cap_start));
+ ctime(&_ftime));
+ }
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) {
+ _ftime = (time_t)fth->cap_end;
fprintf(std, "%c capture end: %s", cc,
- ctime((time_t*)&fth->cap_end));
+ ctime(&_ftime));
+ }
period = fth->cap_end - fth->cap_start;
if ((fields & FT_FIELD_CAP_END) && (fields & FT_FIELD_CAP_START))
diff -Naur flow-tools-0.68.orig/lib/ftstat.c flow-tools-0.68/lib/ftstat.c
--- flow-tools-0.68.orig/lib/ftstat.c 2007-05-15 18:56:54.000000000 +0000
+++ flow-tools-0.68/lib/ftstat.c 2007-05-15 18:51:00.000000000 +0000
@@ -12363,7 +12363,7 @@
{
int comma, sort_field;
char *buf, fmt_buf[32];
- time_t now;
+ time_t now, _ftime;
/* shortcut */
if (!(rpt->out->options & FT_STAT_OPT_HEADER))
@@ -12619,11 +12619,13 @@
fprintf(fp, "# records_shown: %s\n", fmt_buf);
}
+ _ftime = (time_t)rpt->time_start;
fprintf(fp, "# first-flow: %lu %s",
- (unsigned long)rpt->time_start, ctime((time_t*)&rpt->time_start));
+ (unsigned long)rpt->time_start, ctime(&_ftime));
+ _ftime = (time_t)rpt->time_end;
fprintf(fp, "# last-flow: %lu %s",
- (unsigned long)rpt->time_end, ctime((time_t*)&rpt->time_end));
+ (unsigned long)rpt->time_end, ctime(&_ftime));
now = time((time_t*)0L);
|