mirror of
https://github.com/GOSTSec/sgminer
synced 2025-09-03 09:42:17 +00:00
Prevent crash from statline dereference if cgminer is quit before setting up fully.
This commit is contained in:
parent
b69aa23470
commit
c786ac3b2a
12
main.c
12
main.c
@ -2026,8 +2026,10 @@ static void text_print_status(int thr_id)
|
|||||||
struct cgpu_info *cgpu = thr_info[thr_id].cgpu;
|
struct cgpu_info *cgpu = thr_info[thr_id].cgpu;
|
||||||
char logline[255];
|
char logline[255];
|
||||||
|
|
||||||
get_statline(logline, cgpu);
|
if (cgpu) {
|
||||||
printf("%s\n", logline);
|
get_statline(logline, cgpu);
|
||||||
|
printf("%s\n", logline);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Must be called with curses mutex lock held and curses_active */
|
/* Must be called with curses mutex lock held and curses_active */
|
||||||
@ -5339,8 +5341,10 @@ static void log_print_status(int thr_id)
|
|||||||
char logline[255];
|
char logline[255];
|
||||||
|
|
||||||
cgpu = thr_info[thr_id].cgpu;
|
cgpu = thr_info[thr_id].cgpu;
|
||||||
get_statline(logline, cgpu);
|
if (cgpu) {
|
||||||
applog(LOG_WARNING, "%s", logline);
|
get_statline(logline, cgpu);
|
||||||
|
applog(LOG_WARNING, "%s", logline);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_summary(void)
|
static void print_summary(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user