]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
Missing comma in list of initializers.
[tcpdump] / tcpdump.c
index 2dac01aad5b8067d85ecc00e74409a7bdfed0fab..3fe1484480764c2649c2328501ebdcdb1ea242d1 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -299,21 +299,21 @@ show_dlts_and_exit(const char *device)
 static void
 show_devices_and_exit (void)
 {
-       pcap_if_t *p, *devpointer;
+       pcap_if_t *dev, *devlist;
        char ebuf[PCAP_ERRBUF_SIZE];
        int i;
 
-       if (pcap_findalldevs(&devpointer, ebuf) < 0)
+       if (pcap_findalldevs(&devlist, ebuf) < 0)
                error("%s", ebuf);
-       for (i = 0, p = devpointer; p != NULL; i++, p = p->next) {
-               printf("%d.%s", i+1, p->name);
-               if (p->description != NULL)
-                       printf(" (%s)", p->description);
-               if (p->flags != 0)
-                       printf(" [%s]", bittok2str(status_flags, "none", p->flags));
+       for (i = 0, dev = devlist; dev != NULL; i++, dev = dev->next) {
+               printf("%d.%s", i+1, dev->name);
+               if (dev->description != NULL)
+                       printf(" (%s)", dev->description);
+               if (dev->flags != 0)
+                       printf(" [%s]", bittok2str(status_flags, "none", dev->flags));
                printf("\n");
        }
-       pcap_freealldevs(devpointer);
+       pcap_freealldevs(devlist);
        exit(0);
 }
 #endif /* HAVE_PCAP_FINDALLDEVS */
@@ -714,7 +714,7 @@ main(int argc, char **argv)
        char *ret = NULL;
        char *end;
 #ifdef HAVE_PCAP_FINDALLDEVS
-       pcap_if_t *p, *devpointer;
+       pcap_if_t *dev, *devlist;
        int devnum;
 #endif
        int status;
@@ -881,20 +881,20 @@ main(int argc, char **argv)
                                if (devnum < 0)
                                        error("Invalid adapter index");
 
-                               if (pcap_findalldevs(&devpointer, ebuf) < 0)
+                               if (pcap_findalldevs(&devlist, ebuf) < 0)
                                        error("%s", ebuf);
                                /*
                                 * Look for the devnum-th entry in the
                                 * list of devices (1-based).
                                 */
-                               for (i = 0, p = devpointer;
-                                   i < devnum-1 && p != NULL;
-                                   i++, p = p->next)
+                               for (i = 0, dev = devlist;
+                                   i < devnum-1 && dev != NULL;
+                                   i++, dev = dev->next)
                                        ;
-                               if (p == NULL)
+                               if (dev == NULL)
                                        error("Invalid adapter index");
-                               device = strdup(p->name);
-                               pcap_freealldevs(devpointer);
+                               device = strdup(dev->name);
+                               pcap_freealldevs(devlist);
                                break;
                        }
 #endif /* HAVE_PCAP_FINDALLDEVS */
@@ -1247,7 +1247,7 @@ main(int argc, char **argv)
                                VFile = fopen(VFileName, "r");
 
                        if (VFile == NULL)
-                               error("Unable to open file: %s\n", strerror(errno));
+                               error("Unable to open file: %s\n", pcap_strerror(errno));
 
                        ret = get_next_file(VFile, VFileLine);
                        if (!ret)
@@ -1288,10 +1288,10 @@ main(int argc, char **argv)
                 */
                if (device == NULL) {
 #ifdef HAVE_PCAP_FINDALLDEVS
-                       if (pcap_findalldevs(&devpointer, ebuf) >= 0 &&
-                           devpointer != NULL) {
-                               device = strdup(devpointer->name);
-                               pcap_freealldevs(devpointer);
+                       if (pcap_findalldevs(&devlist, ebuf) >= 0 &&
+                           devlist != NULL) {
+                               device = strdup(devlist->name);
+                               pcap_freealldevs(devlist);
                        }
 #else /* HAVE_PCAP_FINDALLDEVS */
                        device = pcap_lookupdev(ebuf);
@@ -1906,7 +1906,7 @@ compress_savefile(const char *filename)
                        "compress_savefile:execlp(%s, %s): %s\n",
                        zflag,
                        filename,
-                       strerror(errno));
+                       pcap_strerror(errno));
 # ifdef HAVE_FORK
        exit(1);
 # else