summaryrefslogtreecommitdiffstats
path: root/lib/keychain.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-05-11 12:16:44 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-05-11 13:08:47 +0200
commit6006b807b1a84d31611173b837fafcd96ba9d692 (patch)
tree08f25453328d8c408f1a8c658e4e6ef91005d4a7 /lib/keychain.c
parentripd: Use correct usage of memcpy() when zeroing struct (diff)
downloadfrr-6006b807b1a84d31611173b837fafcd96ba9d692.tar.xz
frr-6006b807b1a84d31611173b837fafcd96ba9d692.zip
*: 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 'lib/keychain.c')
-rw-r--r--lib/keychain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/keychain.c b/lib/keychain.c
index c29c45a11..5dcb572a3 100644
--- a/lib/keychain.c
+++ b/lib/keychain.c
@@ -542,7 +542,7 @@ static time_t key_str2time(const char *time_str, const char *day_str,
/* Check year_str. Year must be <1993-2035>. */
GET_LONG_RANGE(year, year_str, 1993, 2035);
- memset(&tm, 0, sizeof(struct tm));
+ memset(&tm, 0, sizeof(tm));
tm.tm_sec = sec;
tm.tm_min = min;
tm.tm_hour = hour;