Skip to content

Commit fce19e3

Browse files
puppable0w0mewo
authored andcommitted
countdown timer: Fix divide-by-zero crash when setting time to 00:00:00
`expected_count` is set to be a minimum of 1 to avoid dividing by zero at the bottom of the affected function. The progress bar at the top now renders as empty when the time is set to zero.
1 parent 2d24e1a commit fce19e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

views/countdown_view.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static void countdown_timer_view_on_draw(Canvas* canvas, void* ctx) {
9393
char buffer[64];
9494

9595
int32_t count = model->count;
96-
int32_t expected_count = model->saved_count_setting;
96+
int32_t expected_count = MAX(model->saved_count_setting, 1);
9797

9898
CountDownViewSelect select = model->select;
9999

0 commit comments

Comments
 (0)