Fix long-standing bug in xplot's parsing of timevals, which causes

tcpdump2xplot output to show as starting at (in PST) 16:00:00, and for
time to wrap on long traces.

Re-submitted to Tim Shepard for inclusion in the next release.
This commit is contained in:
jonathan 1998-03-31 21:42:01 +00:00
parent 16e1a66971
commit d0add27bcf
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,16 @@
--- timeval.c.DIST Fri Jun 28 12:41:21 1996
+++ timeval.c Mon Mar 30 19:58:50 1998
@@ -102,6 +102,13 @@
r.t.tv_sec = atoi(s);
while (isdigit(*s)) s++;
+ while (*s == ':') {
+ s++;
+ r.t.tv_sec *= 60;
+ r.t.tv_sec += atoi(s);
+ while (isdigit(*s)) s++;
+ }
+
if (*s == '.') {
s++;
r.t.tv_usec = atoi(s);

View file

@ -0,0 +1,16 @@
--- timeval.c.DIST Fri Jun 28 12:41:21 1996
+++ timeval.c Mon Mar 30 19:58:50 1998
@@ -102,6 +102,13 @@
r.t.tv_sec = atoi(s);
while (isdigit(*s)) s++;
+ while (*s == ':') {
+ s++;
+ r.t.tv_sec *= 60;
+ r.t.tv_sec += atoi(s);
+ while (isdigit(*s)) s++;
+ }
+
if (*s == '.') {
s++;
r.t.tv_usec = atoi(s);