Fix logical error, read before set, found by Valgrind

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-11-14 12:17:41 +01:00
parent 505a7214a8
commit d7485c59ec
+2 -1
View File
@@ -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);