Cleanup dawn-overflowing deadline

master
Kenny Levinsen 2020-10-07 22:02:02 +02:00
parent 3186967e1d
commit 9922bdeeef
1 changed files with 1 additions and 2 deletions

3
main.c
View File

@ -337,8 +337,7 @@ static void update_timer(struct context *ctx, timer_t timer, time_t now) {
} else if (now < ctx->dusk) {
deadline = now + increments(ctx->high_temp - ctx->low_temp, ctx->dusk - ctx->sunset);
} else {
deadline = ctx->dawn;
deadline = ((deadline / 86400 + 1) * 86400);
deadline = (ctx->dawn / 86400 + 1) * 86400;
}
assert(deadline > now);