]> The Tcpdump Group git mirrors - libpcap/commitdiff
replace bzero with memset
authorassar <assar>
Sat, 29 Jul 2000 08:03:56 +0000 (08:03 +0000)
committerassar <assar>
Sat, 29 Jul 2000 08:03:56 +0000 (08:03 +0000)
pcap-bpf.c
pcap-nit.c
pcap-pf.c
pcap-snit.c
pcap-snoop.c

index 054766fb14f9d37026027fb6a044645f5ad80163..a8a03a9fe93f3738352bb6b594275b0ed64bbe52 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.38 2000-07-14 06:25:49 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.39 2000-07-29 08:03:56 assar Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -176,7 +176,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
                    pcap_strerror(errno));
                return (NULL);
        }
-       bzero(p, sizeof(*p));
+       memset(p, 0, sizeof(*p));
        fd = bpf_open(p, ebuf);
        if (fd < 0)
                goto bad;
index 1538b0c63a5e2d3cfe24c65723c2e3132e76555f..54715acad8d8fc6964230640bbcff30e25d225e8 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.35 2000-07-11 00:37:06 assar Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.36 2000-07-29 08:03:56 assar Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -161,7 +161,7 @@ nit_setflags(int fd, int promisc, int to_ms, char *ebuf)
 {
        struct nit_ioc nioc;
 
-       bzero((char *)&nioc, sizeof(nioc));
+       memset(&nioc, 0, sizeof(nioc));
        nioc.nioc_bufspace = BUFSPACE;
        nioc.nioc_chunksize = CHUNKSIZE;
        nioc.nioc_typetomatch = NT_ALLTYPES;
@@ -204,7 +204,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
                 */
                snaplen = 96;
 
-       bzero(p, sizeof(*p));
+       memset(p, 0, sizeof(*p));
        p->fd = fd = socket(AF_NIT, SOCK_RAW, NITPROTO_RAW);
        if (fd < 0) {
                snprintf(ebuf, PCAP_ERRBUF_SIZE,
index fd60aece7c198cfc35f9a3ef548145ff00c96bfb..fec06d0d317d9def56b0d78d1377d1617d414967 100644 (file)
--- a/pcap-pf.c
+++ b/pcap-pf.c
@@ -24,7 +24,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-pf.c,v 1.58 2000-07-11 00:37:06 assar Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-pf.c,v 1.59 2000-07-29 08:03:57 assar Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -216,7 +216,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
                    "pcap_open_live: %s", pcap_strerror(errno));
                return (0);
        }
-       bzero((char *)p, sizeof(*p));
+       memset(p, 0, sizeof(*p));
        p->fd = pfopen(device, O_RDONLY);
        if (p->fd < 0) {
                snprintf(ebuf, PCAP_ERRBUF_SIZE, "pf open: %s: %s\n\
@@ -294,7 +294,7 @@ your system may not be properly configured; see \"man packetfilter(4)\"\n",
        }
        p->snapshot = snaplen;
        /* accept all packets */
-       bzero((char *)&Filter, sizeof(Filter));
+       memset(&Filter, 0, sizeof(Filter));
        Filter.enf_Priority = 37;       /* anything > 2 */
        Filter.enf_FilterLen = 0;       /* means "always true" */
        if (ioctl(p->fd, EIOCSETF, (caddr_t)&Filter) < 0) {
index 730a53bc23ab0fabbd6574c03abc334e913e8a1c..1cdbc21062b6fee74ce81aa8e6baff165dd21a64 100644 (file)
@@ -25,7 +25,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.50 2000-07-11 00:37:07 assar Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.51 2000-07-29 08:03:57 assar Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -223,7 +223,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
                 */
                snaplen = 96;
 
-       bzero(p, sizeof(*p));
+       memset(p, 0, sizeof(*p));
        p->fd = fd = open(dev, O_RDONLY);
        if (fd < 0) {
                snprintf(ebuf, PCAP_ERRBUF_SIZE, "%s: %s", dev,
index c0029eeedff8ba64f71210f0f839fbf9188652b1..c532b309839bb647ef978458064ab814884d8248 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.26 2000-07-11 00:37:07 assar Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.27 2000-07-29 08:03:57 assar Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -108,7 +108,7 @@ pcap_stats(pcap_t *p, struct pcap_stat *ps)
        struct rawstats rawstats;
 
        rs = &rawstats;
-       bzero((char *)rs, sizeof(*rs));
+       memset(rs, 0, sizeof(*rs));
        if (ioctl(p->fd, SIOCRAWSTATS, (char *)rs) < 0) {
                snprintf(p->errbuf, sizeof(p->errbuf),
                    "SIOCRAWSTATS: %s", pcap_strerror(errno));
@@ -142,7 +142,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
                    pcap_strerror(errno));
                return (NULL);
        }
-       bzero((char *)p, sizeof(*p));
+       memset(p, 0, sizeof(*p));
        fd = socket(PF_RAW, SOCK_RAW, RAWPROTO_SNOOP);
        if (fd < 0) {
                snprintf(ebuf, PCAP_ERRBUF_SIZE, "snoop socket: %s",
@@ -150,7 +150,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
                goto bad;
        }
        p->fd = fd;
-       bzero((char *)&sr, sizeof(sr));
+       memset(&sr, 0, sizeof(sr));
        sr.sr_family = AF_RAW;
        (void)strncpy(sr.sr_ifname, device, sizeof(sr.sr_ifname));
        if (bind(fd, (struct sockaddr *)&sr, sizeof(sr))) {
@@ -158,7 +158,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
                    pcap_strerror(errno));
                goto bad;
        }
-       bzero((char *)&sf, sizeof(sf));
+       memset(&sf, 0, sizeof(sf));
        if (ioctl(fd, SIOCADDSNOOP, &sf) < 0) {
                snprintf(ebuf, PCAP_ERRBUF_SIZE, "SIOCADDSNOOP: %s",
                    pcap_strerror(errno));