]> git.earman.xyz Git - sensor-watch.git/commitdiff
sunrise_sunset_face: Fix use of uninitialized memory.
authorWesley Aptekar-Cassels <me@wesleyac.com>
Sun, 19 Nov 2023 04:53:24 +0000 (23:53 -0500)
committerWesley Aptekar-Cassels <me@wesleyac.com>
Sun, 19 Nov 2023 04:53:24 +0000 (23:53 -0500)
This was causing a crash in the simulator when setting the location.

Fixes: #198
movement/watch_faces/complication/sunrise_sunset_face.c

index 82de9c6ec1bb6cff7798c9d66d7b99b2d9422f53..7330c42c0006e83a6752d6da1e875a6376b38b53 100644 (file)
@@ -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;