Wireshark-bugs: [Wireshark-bugs] [Bug 2207] New: editcap relies on gnu extension to strptime(3)
Date: Thu, 17 Jan 2008 17:52:01 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2207

           Summary: editcap relies on gnu extension to strptime(3)
           Product: Wireshark
           Version: 0.99.7
          Platform: Other
        OS/Version: OpenBSD
            Status: NEW
          Severity: Major
          Priority: Low
         Component: Extras
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: bugzilla.wireshark@xxxxxxxxxxxxx


Build Information:
wireshark 0.99.7

Copyright 1998-2007 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled with GTK+ 2.12.2, with GLib 2.14.4, with libpcap 0.5, with libz 1.2.3,
with libpcre 7.5, without SMI, without ADNS, without Lua, with GnuTLS 2.0.4,
with Gcrypt 1.2.4, with Heimdal Kerberos, without PortAudio, without AirPcap.

Running on OpenBSD 4.2, with OpenBSD libpcap.

Built using gcc 3.3.5 (propolice).

--
tarpit2:home/rd 531>editcap -A '2008-01-11 11:11:11' in out
editcap: "2008-01-11 11:11:11" isn't a valid time format

editcap depends on a gnu extension "%F" to strptime rather than using the
function as spec'd in the X/Open Portability Guide Issue 4.2.

Here <http://www.opengroup.org/onlinepubs/009695399/functions/strptime.html> is
a unix man page for strptime.

The following fix uses only the arguments from the X/Open version of strptime:

--- editcap.c.orig      Mon Dec 17 20:16:14 2007
+++ editcap.c   Tue Jan 15 13:43:28 2008
@@ -518,7 +518,7 @@ int main(int argc, char *argv[])

       memset(&starttm,0,sizeof(struct tm));

-      if(!strptime(optarg,"%F %T",&starttm)) {
+      if(!strptime(optarg,"%Y-%m-%d %T",&starttm)) {
         fprintf(stderr, "editcap: \"%s\" isn't a valid time format\n\n",
optarg);
         exit(1);
       }
@@ -537,7 +537,7 @@ int main(int argc, char *argv[])

       memset(&stoptm,0,sizeof(struct tm));

-      if(!strptime(optarg,"%F %T",&stoptm)) {
+      if(!strptime(optarg,"%Y-%m-%d %T",&stoptm)) {
         fprintf(stderr, "editcap: \"%s\" isn't a valid time format\n\n",
optarg);
         exit(1);
       }


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.