From eb358743d719d00792534595a52f5636a7400bb1 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Wed, 23 Dec 2020 22:48:15 +0700 Subject: [PATCH] Use memset instead of bzero. --- inc/version.h | 2 -- src/Cldeetr.c | 3 ++- src/ether.c | 7 ++++--- src/ldeether.c | 3 ++- src/oether.c | 7 ++++--- src/oldeether.c | 3 ++- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/inc/version.h b/inc/version.h index 8e9bc4ff..938104f9 100755 --- a/inc/version.h +++ b/inc/version.h @@ -289,8 +289,6 @@ typedef unsigned char u_char; typedef unsigned long u_int; typedef signed char s_char; typedef unsigned short u_short; - /* DOS doesn't have the BSD bzero &c functions */ -#define bzero(place,len) memset(place, 0, len) #undef UNALIGNED_FETCH_OK #undef HAS_GETHOSTID #undef REGISTER diff --git a/src/Cldeetr.c b/src/Cldeetr.c index 4d099653..9366e7df 100644 --- a/src/Cldeetr.c +++ b/src/Cldeetr.c @@ -17,6 +17,7 @@ #include "version.h" #include +#include #include #include #include @@ -99,7 +100,7 @@ int main(int argc, char *argv[]) perror("Couldn't GIFCONF socket; Net is off"); #else /* OS4 */ - bzero(ifbuf, sizeof(ifbuf)); + memset(ifbuf, 0, sizeof(ifbuf)); { /* we have to get the interface name from another socket, since /dev/nit doesn't know anything until it gets bound, and we diff --git a/src/ether.c b/src/ether.c index 50dc0174..0629ce30 100644 --- a/src/ether.c +++ b/src/ether.c @@ -18,6 +18,7 @@ #endif #include +#include #include #include #ifndef DOS @@ -850,7 +851,7 @@ void init_ether() { if_data.ifc_len = sizeof(ifbuf); if_data.ifc_req = ifbuf; /* 4.0 - before the SIOCGIFCONF, do: - bzero(ifbuf, sizeof(ifbuf)) + memset(ifbuf, 0, sizeof(ifbuf)) */ if (ioctl(ether_fd, SIOCGIFCONF, &if_data) < 0) { perror("Couldn't GIFCONF socket; Net is off"); @@ -877,7 +878,7 @@ void init_ether() { } if_data.ifc_len = sizeof(ifbuf); if_data.ifc_req = ifbuf; - bzero(ifbuf, sizeof(ifbuf)); + memset(ifbuf, 0, sizeof(ifbuf)); { /* we have to get the interface name from another socket, since /dev/nit doesn't know anything until it gets bound, and we @@ -978,7 +979,7 @@ void init_ether() { #ifndef PKTFILTER /* establish the operating modes */ - bzero(&nioc, sizeof(nioc)); + memset(&nioc, 0, sizeof(nioc)); nioc.nioc_bufspace = 20000; nioc.nioc_chunksize = 50; /* small chunks so each packet read */ nioc.nioc_typetomatch = NT_ALLTYPES; diff --git a/src/ldeether.c b/src/ldeether.c index 67d7fe85..3e152497 100644 --- a/src/ldeether.c +++ b/src/ldeether.c @@ -18,6 +18,7 @@ int main(int argc, char *argv[]) { return (0); } /* THERE -IS- AN ETHERNET */ #include +#include #ifdef USE_DLPI #include @@ -168,7 +169,7 @@ int main(int argc, char *argv[]) { perror("Couldn't GIFCONF socket; Net is off"); #else /* OS4 */ - bzero(ifbuf, sizeof(ifbuf)); + memset(ifbuf, 0, sizeof(ifbuf)); { /* we have to get the interface name from another socket, since /dev/nit doesn't know anything until it gets bound, and we diff --git a/src/oether.c b/src/oether.c index 9fea56dc..198f3d04 100644 --- a/src/oether.c +++ b/src/oether.c @@ -11,6 +11,7 @@ #include "version.h" #include +#include #include #ifndef DOS #include @@ -659,7 +660,7 @@ void init_ether() { if_data.ifc_len = sizeof(ifbuf); if_data.ifc_req = ifbuf; /* 4.0 - before the SIOCGIFCONF, do: - bzero(ifbuf, sizeof(ifbuf)) + memset(ifbuf, 0, sizeof(ifbuf)) */ if (ioctl(ether_fd, SIOCGIFCONF, &if_data) < 0) { perror("Couldn't GIFCONF socket; Net is off"); @@ -686,7 +687,7 @@ void init_ether() { } if_data.ifc_len = sizeof(ifbuf); if_data.ifc_req = ifbuf; - bzero(ifbuf, sizeof(ifbuf)); + memset(ifbuf, 0, sizeof(ifbuf)); { /* we have to get the interface name from another socket, since /dev/nit doesn't know anything until it gets bound, and we @@ -783,7 +784,7 @@ if (ether_fd >= 0) { #ifndef OS4 /* establish the operating modes */ - bzero(&nioc, sizeof(nioc)); + memset(&nioc, 0, sizeof(nioc)); nioc.nioc_bufspace = 20000; nioc.nioc_chunksize = 50; /* small chunks so each packet read */ nioc.nioc_typetomatch = NT_ALLTYPES; diff --git a/src/oldeether.c b/src/oldeether.c index c4052b0e..b69d3a5f 100644 --- a/src/oldeether.c +++ b/src/oldeether.c @@ -16,6 +16,7 @@ int main(int argc, char *argv[]) #else #include +#include #include #include #include @@ -97,7 +98,7 @@ int main(int argc, char *argv[]) perror("Couldn't GIFCONF socket; Net is off"); #else /* OS4 */ - bzero(ifbuf, sizeof(ifbuf)); + memset(ifbuf, 0, sizeof(ifbuf)); { /* we have to get the interface name from another socket, since /dev/nit doesn't know anything until it gets bound, and we