Commit c217f4cc223571ce21005bd0f570f15691c1c81f

Con Kolivas 2012-12-12T15:29:00

Merge pull request #363 from kanoi/icarus Benchmark incorrect work size

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cgminer.c b/cgminer.c
index 6f3b793..bb4c2f7 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2657,10 +2657,10 @@ static void get_benchmark_work(struct work *work)
 	// Use a random work block pulled from a pool
 	static uint8_t bench_block[] = { CGMINER_BENCHMARK_BLOCK };
 
-	size_t bench_size = sizeof(work);
+	size_t bench_size = sizeof(*work);
 	size_t work_size = sizeof(bench_block);
 	size_t min_size = (work_size < bench_size ? work_size : bench_size);
-	memset(work, 0, sizeof(work));
+	memset(work, 0, sizeof(*work));
 	memcpy(work, &bench_block, min_size);
 	work->mandatory = true;
 	work->pool = pools[0];