From f2bd34c82a9873f1f783212c6c2e9bfea9029fb7 Mon Sep 17 00:00:00 2001 From: Kosma Moczek Date: Fri, 3 Jun 2022 00:53:40 +0200 Subject: [PATCH] minmea_getdate: use pointer dereferencing for memset (safer) --- minmea.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minmea.c b/minmea.c index 26e8ae3..4a3dbbd 100644 --- a/minmea.c +++ b/minmea.c @@ -617,7 +617,7 @@ int minmea_getdate(struct tm *out, const struct minmea_date *date, const struct if (date->year == -1 || time_->hours == -1) return -1; - memset(out, 0, sizeof(struct tm)); + memset(out, 0, sizeof(*out)); if (date->year < 80) { out->tm_year = 2000 + date->year - 1900; // 2000-2079 } else if (date->year >= 1900) {