From: Joey Castillo Date: Mon, 25 Oct 2021 22:32:59 +0000 (-0400) Subject: don't destroy our temperature log when waking from sleep X-Git-Url: https://git.earman.xyz/?a=commitdiff_plain;h=88f41b12fc99542e2ace7b63651971e5907cfd1d;p=sensor-watch.git don't destroy our temperature log when waking from sleep --- diff --git a/movement/watch_faces/thermistor/thermistor_logging_face.c b/movement/watch_faces/thermistor/thermistor_logging_face.c index 5351ce8..3e9e62b 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) {