mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Replace bzero() with memset()
This commit is contained in:
parent
62206825e4
commit
2e5f96f5a9
2 changed files with 4 additions and 7 deletions
|
@ -80,12 +80,12 @@ Connection::Connection(NetSessions* s, const ConnIDKey& k, double t, const ConnI
|
||||||
if ( pkt->l2_src )
|
if ( pkt->l2_src )
|
||||||
memcpy(orig_l2_addr, pkt->l2_src, sizeof(orig_l2_addr));
|
memcpy(orig_l2_addr, pkt->l2_src, sizeof(orig_l2_addr));
|
||||||
else
|
else
|
||||||
bzero(orig_l2_addr, sizeof(orig_l2_addr));
|
memset(orig_l2_addr, 0, sizeof(orig_l2_addr));
|
||||||
|
|
||||||
if ( pkt->l2_dst )
|
if ( pkt->l2_dst )
|
||||||
memcpy(resp_l2_addr, pkt->l2_dst, sizeof(resp_l2_addr));
|
memcpy(resp_l2_addr, pkt->l2_dst, sizeof(resp_l2_addr));
|
||||||
else
|
else
|
||||||
bzero(resp_l2_addr, sizeof(resp_l2_addr));
|
memset(resp_l2_addr, 0, sizeof(resp_l2_addr));
|
||||||
|
|
||||||
vlan = pkt->vlan;
|
vlan = pkt->vlan;
|
||||||
inner_vlan = pkt->inner_vlan;
|
inner_vlan = pkt->inner_vlan;
|
||||||
|
|
|
@ -27,14 +27,11 @@ private:
|
||||||
unsigned char* set;
|
unsigned char* set;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define bzero(p, size) memset(p, 0, size)
|
|
||||||
|
|
||||||
inline IntSet::IntSet(unsigned int n)
|
inline IntSet::IntSet(unsigned int n)
|
||||||
{
|
{
|
||||||
size = n / 8 + 1;
|
size = n / 8 + 1;
|
||||||
set = new unsigned char[size];
|
set = new unsigned char[size];
|
||||||
bzero(set, size);
|
memset(set, 0, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline IntSet::~IntSet()
|
inline IntSet::~IntSet()
|
||||||
|
@ -65,5 +62,5 @@ inline bool IntSet::Contains(unsigned int i) const
|
||||||
|
|
||||||
inline void IntSet::Clear()
|
inline void IntSet::Clear()
|
||||||
{
|
{
|
||||||
bzero(set, size);
|
memset(set, 0, size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue