Ethereal-dev: [Ethereal-dev] pcap_lookupdev/preferences patch

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

From: aferen@xxxxxxxxxxxx (Andrew C. Feren)
Date: 22 Apr 2002 15:15:36 -0400
If WinPcap is not installed trying to open "Edit -> Preferences..." aborts.

The rest of the code already seems to assume that pcap_lookupdev will
return NULL is some instances so returning NULL instead of aborting
seems to be sufficient.

Index: capture-wpcap.c
===================================================================
RCS file: /cvsroot/ethereal/capture-wpcap.c,v
retrieving revision 1.1
diff -u -r1.1 capture-wpcap.c
--- capture-wpcap.c	2001/04/03 05:26:26	1.1
+++ capture-wpcap.c	2002/04/22 19:09:41
@@ -109,7 +109,7 @@
 char*
 pcap_lookupdev (char *a)
 {
-	g_assert(has_wpcap);
+	if(!has_wpcap) return 0;
 	return p_pcap_lookupdev(a);
 }
 

-- 
-Andrew Feren
 Cetacean Networks, Inc.
 Portsmouth, NH