From 413e6b864545538a6db780bc7b330e227800dd33 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 5 Jul 2011 22:08:13 +1000 Subject: [PATCH] Fix potential divide by zero. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 895bcf3b..6736b7ae 100644 --- a/main.c +++ b/main.c @@ -969,7 +969,7 @@ static void *miner_thread(void *userdata) /* adjust max_nonce to meet target cycle time */ if (diff.tv_usec > 500000) diff.tv_sec++; - if (diff.tv_sec != cycle) { + if (diff.tv_sec && diff.tv_sec != cycle) { max64 = work.blk.nonce + ((uint64_t)hashes_done * cycle) / diff.tv_sec; } else