1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Avoid possible divide by zero.

This commit is contained in:
Con Kolivas 2011-07-11 22:57:17 +10:00
parent 43ef5f5d3f
commit c59e2ab8b6

2
main.c
View File

@ -1010,7 +1010,7 @@ static void hashmeter(int thr_id, struct timeval *diff,
khashes = hashes_done / 1000.0; khashes = hashes_done / 1000.0;
secs = (double)diff->tv_sec + ((double)diff->tv_usec / 1000000.0); secs = (double)diff->tv_sec + ((double)diff->tv_usec / 1000000.0);
if (thr_id >= 0) { if (thr_id >= 0 && secs) {
/* So we can call hashmeter from a non worker thread */ /* So we can call hashmeter from a non worker thread */
struct cgpu_info *cgpu = thr_info[thr_id].cgpu; struct cgpu_info *cgpu = thr_info[thr_id].cgpu;