aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-09-14 18:09:15 +1200
committerDavid Phillips <david@sighup.nz>2017-09-14 18:09:15 +1200
commit9fd396ccaba7ac3d462c8be89f3fb08295ce7e0a (patch)
tree98071ac1359152642945b2d35380657fae0dd4bc
parentd34c4fb99a770add02347b29e7c0bb9a46ec7dc1 (diff)
downloadsand-leek-9fd396ccaba7ac3d462c8be89f3fb08295ce7e0a.tar.xz
Fix accidental regression with never-zero loop count
-rw-r--r--sand-leek.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sand-leek.c b/sand-leek.c
index 338f455..36f9503 100644
--- a/sand-leek.c
+++ b/sand-leek.c
@@ -227,8 +227,8 @@ monitor_progress(unsigned long volatile *khashes, int thread_count) {
fprintf(stderr, "Last second: %lu kH/s (%.2f kH/s/thread) | Average: %.2f kH/s (%.2f kH/s/thread)\r",
total_khashes - last_total_khashes,
(double)(total_khashes - last_total_khashes) / thread_count,
- (double)total_khashes / (loops || 1),
- ((double)total_khashes / (loops || 1)) / thread_count);
+ (double)total_khashes / (loops ? loops : 1),
+ ((double)total_khashes / (loops ? loops : 1)) / thread_count);
sleep(1);
loops++;
}