Skip to content

Commit

Permalink
nmea: Fix tm_isdst uninitialized
Browse files Browse the repository at this point in the history
tm_isdst of the tm struct was uninitialized. Causing it to read random
values and applying daylight savings time in certain cases.

Signed-off-by: Nicolas Thivierge <nicolasthivierge24@gmail.com>
  • Loading branch information
Nicolas200124 authored and richardcochran committed Sep 2, 2024
1 parent fe7cf81 commit 0bec0dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nmea.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static int nmea_scan_rmc(struct nmea_parser *np, struct nmea_rmc *result)
int cnt, i, msec = 0;
char *ptr, status;
uint8_t checksum;
struct tm tm;
struct tm tm = {0};

pr_debug("nmea sentence: %s", np->sentence);
cnt = sscanf(np->payload_checksum, "%02hhx", &checksum);
Expand Down

0 comments on commit 0bec0dc

Please sign in to comment.