Commit 9bb1a3c0a895a15010cecf8dcbb993a9b782a932

Paul Sheppard 2012-05-18T17:43:03

Merge branch 'master' of git@github.com:pshep/cgminer.git

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/cgminer.c b/cgminer.c
index 14dfdaa..4e9e26b 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2623,7 +2623,7 @@ void write_config(FILE *fcfg)
 
 	/* Write pool values in priority order */
 	fputs("{\n\"pools\" : [", fcfg);
-	while(j < total_pools) {
+	while((j < total_pools) && (i < total_pools)) {
 	    if(pools[i]->prio == j) {
 		    fprintf(fcfg, "%s\n\t{\n\t\t\"url\" : \"%s\",", i > 0 ? "," : "", pools[i]->rpc_url);
 		    fprintf(fcfg, "\n\t\t\"user\" : \"%s\",", pools[i]->rpc_user);