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) { } else if (now < ctx->dusk) {
deadline = now + increments(ctx->high_temp - ctx->low_temp, ctx->dusk - ctx->sunset); deadline = now + increments(ctx->high_temp - ctx->low_temp, ctx->dusk - ctx->sunset);
} else { } else {
deadline = ctx->dawn; deadline = (ctx->dawn / 86400 + 1) * 86400;
deadline = ((deadline / 86400 + 1) * 86400);
} }
assert(deadline > now); assert(deadline > now);