1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-07 16:51:21 +00:00

Use memset instead of bzero. (#131)

This commit is contained in:
Bruce Mitchener
2020-12-24 01:34:27 +07:00
committed by GitHub
parent 985f2c43fe
commit 3ef2d12115
6 changed files with 14 additions and 11 deletions

View File

@@ -18,6 +18,7 @@
#endif
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#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;