]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fixed a bug that caused "windump" with no parameters not to display the
authorrisso <risso>
Tue, 6 Apr 2004 13:04:54 +0000 (13:04 +0000)
committerrisso <risso>
Tue, 6 Apr 2004 13:04:54 +0000 (13:04 +0000)
adapter name correctly on win32.
Modified some code so that windump retrieves the winpcap lib version
with "pcap_lib_version()" on win32.
Upgraded the Wpcap_version string to 3.1.

tcpdump.c

index 1cb5130090940793f74e211bd35eabf0fd89e042..106410a174aabb131d3c4432a8b3be85a2d7495f 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -30,7 +30,7 @@ static const char copyright[] _U_ =
     "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
 The Regents of the University of California.  All rights reserved.\n";
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.216.2.10 2004-03-17 19:47:48 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.216.2.11 2004-04-06 13:04:54 risso Exp $ (LBL)";
 #endif
 
 /*
@@ -659,11 +659,8 @@ main(int argc, char **argv)
                                error("%s", ebuf);
                }
 #ifdef WIN32
-               if(IsTextUnicode(device,  
-                       wcslen((short*)device),                // Device always ends with a double \0, so this way to determine its 
-                                                                                                       // length should be always valid
-                       NULL))
-               {
+               if(strlen(device) == 1) //we assume that an ASCII string is always longer than 1 char
+               {                                               //a Unicode string has a \0 as second byte (so strlen() is 1)
                        fprintf(stderr, "%s: listening on %ws\n", program_name, device);
                }
                else
@@ -1062,7 +1059,7 @@ print_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
        char WDversion[]="current-cvs.tcpdump.org";
        char version[]="current-cvs.tcpdump.org";
        char pcap_version[]="current-cvs.tcpdump.org";
-       char Wpcap_version[]="3.0 alpha";
+       char Wpcap_version[]="3.1";
 #endif
 
 /*
@@ -1097,8 +1094,12 @@ usage(void)
 #endif /* HAVE_PCAP_LIB_VERSION */
 
 #ifdef HAVE_PCAP_LIB_VERSION
+#ifdef WIN32
+       (void)fprintf(stderr, "%s version %s, based on tcpdump version %s\n", program_name, WDversion, version);
+#else /* WIN32 */
        (void)fprintf(stderr, "%s version %s\n", program_name, version);
-       (void)fprintf(stderr, "%s\n", pcap_lib_version());
+#endif /* WIN32 */
+       (void)fprintf(stderr, "%s\n",pcap_lib_version());
 #else /* HAVE_PCAP_LIB_VERSION */
 #ifdef WIN32
        (void)fprintf(stderr, "%s version %s, based on tcpdump version %s\n", program_name, WDversion, version);