diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 13:16:44 +0300 | 
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 14:08:47 +0300 | 
| commit | 6006b807b1a84d31611173b837fafcd96ba9d692 (patch) | |
| tree | 08f25453328d8c408f1a8c658e4e6ef91005d4a7 /bgpd/bgp_keepalives.c | |
| parent | f51eeb864bc821d92bd8e95670dde1258ed0747c (diff) | |
*: Properly use memset() when zeroing
    Wrong: memset(&a, 0, sizeof(struct ...));
    Good:  memset(&a, 0, sizeof(a));
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_keepalives.c')
| -rw-r--r-- | bgpd/bgp_keepalives.c | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_keepalives.c b/bgpd/bgp_keepalives.c index 4cb7bd788a..86202a0e3d 100644 --- a/bgpd/bgp_keepalives.c +++ b/bgpd/bgp_keepalives.c @@ -121,7 +121,7 @@ static void peer_process(struct hash_bucket *hb, void *arg)  		bgp_keepalive_send(pkat->peer);  		monotime(&pkat->last); -		memset(&elapsed, 0x00, sizeof(struct timeval)); +		memset(&elapsed, 0, sizeof(elapsed));  		diff = ka;  	} @@ -220,7 +220,7 @@ void *bgp_keepalives_start(void *arg)  		hash_iterate(peerhash, peer_process, &next_update);  		if (next_update.tv_sec == -1) -			memset(&next_update, 0x00, sizeof(next_update)); +			memset(&next_update, 0, sizeof(next_update));  		monotime_since(&currtime, &aftertime);  | 
