]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Rename a variable to avoid collision with stat().
authorGuy Harris <[email protected]>
Thu, 17 Sep 2015 19:23:46 +0000 (12:23 -0700)
committerGuy Harris <[email protected]>
Thu, 17 Sep 2015 19:23:46 +0000 (12:23 -0700)
This eliminates a warning with some compilers.

tcpdump.c

index 548d49173029bb92d9e5dae9d5d1fde2fd4eab6c..8a171c3997b81724a615b8a52e261239f7dd6037 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1837,14 +1837,14 @@ child_cleanup(int signo _U_)
 static void
 info(register int verbose)
 {
-       struct pcap_stat stat;
+       struct pcap_stat stats;
 
        /*
         * Older versions of libpcap didn't set ps_ifdrop on some
         * platforms; initialize it to 0 to handle that.
         */
-       stat.ps_ifdrop = 0;
-       if (pcap_stats(pd, &stat) < 0) {
+       stats.ps_ifdrop = 0;
+       if (pcap_stats(pd, &stats) < 0) {
                (void)fprintf(stderr, "pcap_stats: %s\n", pcap_geterr(pd));
                infoprint = 0;
                return;
@@ -1859,21 +1859,21 @@ info(register int verbose)
                fputs(", ", stderr);
        else
                putc('\n', stderr);
-       (void)fprintf(stderr, "%u packet%s received by filter", stat.ps_recv,
-           PLURAL_SUFFIX(stat.ps_recv));
+       (void)fprintf(stderr, "%u packet%s received by filter", stats.ps_recv,
+           PLURAL_SUFFIX(stats.ps_recv));
        if (!verbose)
                fputs(", ", stderr);
        else
                putc('\n', stderr);
-       (void)fprintf(stderr, "%u packet%s dropped by kernel", stat.ps_drop,
-           PLURAL_SUFFIX(stat.ps_drop));
-       if (stat.ps_ifdrop != 0) {
+       (void)fprintf(stderr, "%u packet%s dropped by kernel", stats.ps_drop,
+           PLURAL_SUFFIX(stats.ps_drop));
+       if (stats.ps_ifdrop != 0) {
                if (!verbose)
                        fputs(", ", stderr);
                else
                        putc('\n', stderr);
                (void)fprintf(stderr, "%u packet%s dropped by interface\n",
-                   stat.ps_ifdrop, PLURAL_SUFFIX(stat.ps_ifdrop));
+                   stats.ps_ifdrop, PLURAL_SUFFIX(stats.ps_ifdrop));
        } else
                putc('\n', stderr);
        infoprint = 0;