mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-30 16:34:23 +00:00
thr_id can be successful as -1 which is wrong and could lead to a crash.
This commit is contained in:
parent
92e04f47cb
commit
215ee79056
4
main.c
4
main.c
@ -537,7 +537,7 @@ static inline void print_status(int thr_id)
|
|||||||
printw("Totals: %s", statusline);
|
printw("Totals: %s", statusline);
|
||||||
clrtoeol();
|
clrtoeol();
|
||||||
|
|
||||||
if (thr_id && thr_id < gpu_threads) {
|
if (thr_id >= 0 && thr_id < gpu_threads) {
|
||||||
int gpu = gpu_from_thr_id(thr_id);
|
int gpu = gpu_from_thr_id(thr_id);
|
||||||
struct cgpu_info *cgpu = &gpus[gpu];
|
struct cgpu_info *cgpu = &gpus[gpu];
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ static inline void print_status(int thr_id)
|
|||||||
cgpu->getworks, cgpu->accepted, cgpu->rejected, cgpu->hw_errors,
|
cgpu->getworks, cgpu->accepted, cgpu->rejected, cgpu->hw_errors,
|
||||||
cgpu->efficiency, cgpu->utility);
|
cgpu->efficiency, cgpu->utility);
|
||||||
clrtoeol();
|
clrtoeol();
|
||||||
} else if (thr_id && thr_id >= gpu_threads) {
|
} else if (thr_id >= gpu_threads) {
|
||||||
int cpu = cpu_from_thr_id(thr_id);
|
int cpu = cpu_from_thr_id(thr_id);
|
||||||
struct cgpu_info *cgpu = &cpus[cpu];
|
struct cgpu_info *cgpu = &cpus[cpu];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user