소스 검색

minmea_getdate: use pointer dereferencing for memset (safer)

Kosma Moczek 3 년 전
부모
커밋
f2bd34c82a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      minmea.c

+ 1 - 1
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) {