From 4d3cc0bc6de3e8be454851e84a6cce70b4aa9ac2 Mon Sep 17 00:00:00 2001 From: Paul Sheppard Date: Fri, 18 May 2012 10:57:19 -0700 Subject: [PATCH] Add check to 'i' (could be considered safer) --- cgminer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgminer.c b/cgminer.c index 14dfdaa5..4e9e26b8 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);