Browse Source

Merge commit '3de753f' into bfgminer

Luke Dashjr 12 years ago
parent
commit
d3abf1ec9c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      driver-bitfury.c

+ 2 - 1
driver-bitfury.c

@@ -285,7 +285,7 @@ void bitfury_noop_job_start(struct thr_info __maybe_unused * const thr)
 void bitfury_init_freq_stat(struct freq_stat * const c, const int osc6_min, const int osc6_max)
 {
 	const int osc6_values = (osc6_max + 1 - osc6_min);
-	void * const p = malloc(osc6_values * (sizeof(*c->mh) + sizeof(*c->s)));
+	void * const p = calloc(osc6_values, (sizeof(*c->mh) + sizeof(*c->s)));
 	c->mh = p - (sizeof(*c->mh) * osc6_min);
 	c->s = p + (sizeof(*c->mh) * osc6_values) - (sizeof(*c->s) * osc6_min);
 	c->osc6_min = osc6_min;
@@ -532,6 +532,7 @@ void bitfury_do_io(struct thr_info * const master_thr)
 				if (opt_debug && !c->best_done)
 				{
 					char logbuf[0x100];
+					logbuf[0] = '\0';
 					for (i = c->osc6_min; i <= c->osc6_max; ++i)
 						tailsprintf(logbuf, sizeof(logbuf), " %d=%.3f/%3.0fs",
 						            i, c->mh[i] / c->s[i], c->s[i]);