summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWesley Aptekar-Cassels <me@wesleyac.com>2023-11-18 23:53:24 -0500
committerWesley Aptekar-Cassels <me@wesleyac.com>2023-11-18 23:53:24 -0500
commit1f6409a71c1309a6d47cf4845d8b39d519bd8ebc (patch)
treea2ddef29c73ea2d4fc064cfb72eada26420e4263
parentc4a5cb463e0d7843dc3ee24b15933bd4d3979121 (diff)
downloadSensor-Watch-1f6409a71c1309a6d47cf4845d8b39d519bd8ebc.tar.gz
Sensor-Watch-1f6409a71c1309a6d47cf4845d8b39d519bd8ebc.tar.bz2
Sensor-Watch-1f6409a71c1309a6d47cf4845d8b39d519bd8ebc.zip
sunrise_sunset_face: Fix use of uninitialized memory.
This was causing a crash in the simulator when setting the location. Fixes: #198
-rw-r--r--movement/watch_faces/complication/sunrise_sunset_face.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/movement/watch_faces/complication/sunrise_sunset_face.c b/movement/watch_faces/complication/sunrise_sunset_face.c
index 82de9c6e..7330c42c 100644
--- a/movement/watch_faces/complication/sunrise_sunset_face.c
+++ b/movement/watch_faces/complication/sunrise_sunset_face.c
@@ -197,6 +197,8 @@ static void _sunrise_sunset_face_update_settings_display(movement_event_t event,
char buf[12];
switch (state->page) {
+ case 0:
+ return;
case 1:
sprintf(buf, "LA %c %04d", state->working_latitude.sign ? '-' : '+', abs(_sunrise_sunset_face_latlon_from_struct(state->working_latitude)));
break;