Ethereal-users: Re: [Ethereal-users] Text2pcap - Timestamps problem on Windows98 (Swedish)

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Martin Regner" <martin.regner@xxxxxxxxx>
Date: Tue, 15 Apr 2003 01:15:59 +0100
It turned out that I didn't come some many lines down in strptime_internal before execution stopped in that procedure.

==== extract ======

printf("test4");
      /* Any character but `%' must be matched by the same character
  in the iput string.  */
      if (*fmt != '%')
 {
   printf("test4b");
   match_char (*fmt++, *rp++);
   continue;
 }
printf("test5");

==========

I just got the outputs:
test4
test4b

but since the format string was starting with a percentage character I would have assumed that I should get
test4
test5
followed by some other test printouts ...

When I replaced       "if (*fmt != '%')"  with   " if (*fmt != 'J')"  then it worked much better, see example below.

I added a printout to print the value of *fmt and it was not '%' (37) as I had expected, but instead it was 'm' (109)
when I had started text2pcap with "%d/%m%Y %H:%M:%S."

============

C:\Program\Ethereal>text2pcap -t "Jd/Jm/JY JH:JM:JS." -l 9 Time.txt Time.pcap >
ut
Input from: Time.txt
Output to: Time.pcap
Timecode tm_sec=24
 tm_min=3
 tm_hour=20
 tm_mday=22
 Tm_mon=10
 tm_year=101
 tm_wday=4
 tm_yday=325
 Time=22/11/2001 20:03:24.4375
Timecode ts_sec=1006459404l
Timecode tm_sec=34
 tm_min=13
 tm_hour=10
 tm_mday=10
 Tm_mon=10
 tm_year=79
 tm_wday=6
 tm_yday=313
 Time=10/11/1979 10:13:34.6093
Timecode ts_sec=311076814l
Timecode tm_sec=14
 tm_min=13
 tm_hour=13
 tm_mday=12
 Tm_mon=9
 tm_year=103
 tm_wday=0
 tm_yday=284
 Time=12/10/2003 13:13:14.8250
Timecode ts_sec=1065960794l
Read 3 potential packets, wrote 0 packets