From d7485c59ec97fd0923e61c902811048491e0833e Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 14 Nov 2017 08:33:58 +0100 Subject: [PATCH] Fix logical error, read before set, found by Valgrind Signed-off-by: Joachim Nilsson --- tests/cronrun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/cronrun.c b/tests/cronrun.c index 66e3d3c..668fbef 100644 --- a/tests/cronrun.c +++ b/tests/cronrun.c @@ -58,10 +58,11 @@ int main(void) uev_init(&ctx); gettimeofday(&tv, NULL); + when = tv.tv_sec + TIMEOUT; + printf("Start of test %s", ctime(&tv.tv_sec)); printf("Expected cron %s", ctime(&when)); - when = tv.tv_sec + TIMEOUT; interval = INTERVAL; uev_cron_init(&ctx, &cron_watcher, cron_job, NULL, when, interval);