From 88f41b12fc99542e2ace7b63651971e5907cfd1d Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Mon, 25 Oct 2021 18:32:59 -0400 Subject: [PATCH] don't destroy our temperature log when waking from sleep --- movement/watch_faces/thermistor/thermistor_logging_face.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/movement/watch_faces/thermistor/thermistor_logging_face.c b/movement/watch_faces/thermistor/thermistor_logging_face.c index 5351ce88..3e9e62b3 100644 --- a/movement/watch_faces/thermistor/thermistor_logging_face.c +++ b/movement/watch_faces/thermistor/thermistor_logging_face.c @@ -50,8 +50,10 @@ void _thermistor_logging_face_update_display(thermistor_logger_state_t *logger_s void thermistor_logging_face_setup(movement_settings_t *settings, void ** context_ptr) { (void) settings; - if (*context_ptr == NULL) *context_ptr = malloc(sizeof(thermistor_logger_state_t)); - memset(*context_ptr, 0, sizeof(thermistor_logger_state_t)); + if (*context_ptr == NULL) { + *context_ptr = malloc(sizeof(thermistor_logger_state_t)); + memset(*context_ptr, 0, sizeof(thermistor_logger_state_t)); + } } void thermistor_logging_face_activate(movement_settings_t *settings, void *context) {