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 /zebra/zebra_netns_notify.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 'zebra/zebra_netns_notify.c')
| -rw-r--r-- | zebra/zebra_netns_notify.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index af6046c9ad..b3cb061242 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -221,7 +221,7 @@ static bool zebra_ns_notify_is_default_netns(const char *name) if (zebra_ns_notify_self_identify(&default_netns_stat)) return false; - memset(&st, 0, sizeof(struct stat)); + memset(&st, 0, sizeof(st)); snprintf(netnspath, sizeof(netnspath), "%s/%s", NS_RUN_DIR, name); /* compare with local stat */ if (stat(netnspath, &st) == 0 && |
