mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 15:27:53 +00:00
save config bugfix: writing an extra ',' when no gpus
This commit is contained in:
parent
8e25239dff
commit
c2e2e7e437
@ -2634,11 +2634,11 @@ void write_config(FILE *fcfg)
|
|||||||
fprintf(fcfg, "\n\t\t\"user\" : \"%s\",", pools[i]->rpc_user);
|
fprintf(fcfg, "\n\t\t\"user\" : \"%s\",", pools[i]->rpc_user);
|
||||||
fprintf(fcfg, "\n\t\t\"pass\" : \"%s\"\n\t}", pools[i]->rpc_pass);
|
fprintf(fcfg, "\n\t\t\"pass\" : \"%s\"\n\t}", pools[i]->rpc_pass);
|
||||||
}
|
}
|
||||||
fputs("\n],\n\n", fcfg);
|
fputs("\n]\n", fcfg);
|
||||||
|
|
||||||
if (nDevs) {
|
if (nDevs) {
|
||||||
/* Write GPU device values */
|
/* Write GPU device values */
|
||||||
fputs("\"intensity\" : \"", fcfg);
|
fputs(",\n\"intensity\" : \"", fcfg);
|
||||||
for(i = 0; i < nDevs; i++)
|
for(i = 0; i < nDevs; i++)
|
||||||
fprintf(fcfg, gpus[i].dynamic ? "%sd" : "%s%d", i > 0 ? "," : "", gpus[i].intensity);
|
fprintf(fcfg, gpus[i].dynamic ? "%sd" : "%s%d", i > 0 ? "," : "", gpus[i].intensity);
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
@ -2701,16 +2701,13 @@ void write_config(FILE *fcfg)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
fputs("\"", fcfg);
|
fputs("\"", fcfg);
|
||||||
#ifdef WANT_CPUMINE
|
|
||||||
fputs(",\n", fcfg);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#ifdef HAVE_ADL
|
#ifdef HAVE_ADL
|
||||||
if (opt_reorder)
|
if (opt_reorder)
|
||||||
fprintf(fcfg, ",\n\"gpu-reorder\" : true");
|
fprintf(fcfg, ",\n\"gpu-reorder\" : true");
|
||||||
#endif
|
#endif
|
||||||
#ifdef WANT_CPUMINE
|
#ifdef WANT_CPUMINE
|
||||||
fprintf(fcfg, "\n\"algo\" : \"%s\"", algo_names[opt_algo]);
|
fprintf(fcfg, ",\n\"algo\" : \"%s\"", algo_names[opt_algo]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Simple bool and int options */
|
/* Simple bool and int options */
|
||||||
|
Loading…
Reference in New Issue
Block a user