Commit e6a50684701cc9e74707ef78d9519d954b4c818c

Con Kolivas 2013-11-02T21:09:37

show_hash doesn't know the size of the string so hard code the max size.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/cgminer.c b/cgminer.c
index 04753de..a86c753 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2727,8 +2727,8 @@ static void show_hash(struct work *work, char *hashshow)
 	h32 = be32toh(*hash32);
 	intdiff = round(work->work_difficulty);
 	suffix_string(work->share_diff, diffdisp, sizeof (diffdisp), 0);
-	snprintf(hashshow, sizeof(hashshow), "%08lx Diff %s/%d%s", h32, diffdisp,
-		 intdiff, work->block? " BLOCK!" : "");
+	snprintf(hashshow, 64, "%08lx Diff %s/%d%s", h32, diffdisp, intdiff,
+		 work->block? " BLOCK!" : "");
 }
 
 static bool submit_upstream_work(struct work *work, CURL *curl, bool resubmit)