summaryrefslogtreecommitdiffstats
path: root/net/dcwifi/libdcwsocket/patches/01_replace_bzero.patch
blob: 9b799e19ad62246c593f1b23bb813f8a78f604f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- a/src/dcwsocket.c.linux
+++ b/src/dcwsocket.c.linux
@@ -100,10 +100,10 @@ dcwsock_open(const char * const ifname) {
   }
 
   /* sanitize our data structs... defensive */
-  bzero(rv, sizeof(*rv));
-  bzero(&ifr, sizeof(ifr));
-  bzero(&sall, sizeof(sall));
-  bzero(&sfp, sizeof(sfp));
+  memset(rv, 0, sizeof(*rv));
+  memset(&ifr, 0, sizeof(ifr));
+  memset(&sall, 0, sizeof(sall));
+  memset(&sfp, 0, sizeof(sfp));
 
   /* open a raw socket... "ETH_P_ALL" says take EVERYTHING 
      (this means that it is IMPERATIVE to apply a filter)
diff --git a/src/dcwsocket.c.osx b/src/dcwsocket.c.osx
index abead10..75cda2f 100644
--- a/src/dcwsocket.c.osx
+++ b/src/dcwsocket.c.osx
@@ -90,10 +90,10 @@ dcwsock_open(const char * const ifname) {
   }
 
   /* sanitize our data structs... defensive */
-  bzero(rv, sizeof(*rv));
-  bzero(&dmx_desc, sizeof(dmx_desc));
-  bzero(&proto_desc, sizeof(proto_desc));
-  bzero(&snd, sizeof(snd));
+  memset(rv, 0, sizeof(*rv));
+  memset(&dmx_desc, 0, sizeof(dmx_desc));
+  memset(&proto_desc, 0, sizeof(proto_desc));
+  memset(&snd, 0, sizeof(snd));
 
   /* open a "NDRV" socket... */
   rv->fd = socket(PF_NDRV, SOCK_RAW, 0);
@@ -201,7 +201,7 @@ dcwsock_send( dcw_socket_t s, const void * const buf, const unsigned buf_size, c
      fill out a link-level sockaddr cause we can only 
      use sendto() with PF_NDRV...
   */
-  bzero(&sdl, sizeof(sdl));
+  memset(&sdl, 0, sizeof(sdl));
   sdl.sdl_len   = sizeof(sdl);
   sdl.sdl_index = 0;
   sdl.sdl_type  = IFT_ETHER;