mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-08 21:14:14 +00:00
Off by one limit in device selection.
This commit is contained in:
parent
f9bc3771b4
commit
d5d56920dd
6
main.c
6
main.c
@ -1859,7 +1859,7 @@ retry:
|
|||||||
|
|
||||||
if (!strncasecmp(&input, "e", 1)) {
|
if (!strncasecmp(&input, "e", 1)) {
|
||||||
selected = curses_int("Select GPU to enable");
|
selected = curses_int("Select GPU to enable");
|
||||||
if (selected < 0 || selected > nDevs) {
|
if (selected < 0 || selected >= nDevs) {
|
||||||
wlogprint("Invalid selection\n");
|
wlogprint("Invalid selection\n");
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
@ -1880,7 +1880,7 @@ retry:
|
|||||||
}
|
}
|
||||||
} if (!strncasecmp(&input, "d", 1)) {
|
} if (!strncasecmp(&input, "d", 1)) {
|
||||||
selected = curses_int("Select GPU to disable");
|
selected = curses_int("Select GPU to disable");
|
||||||
if (selected < 0 || selected > nDevs) {
|
if (selected < 0 || selected >= nDevs) {
|
||||||
wlogprint("Invalid selection\n");
|
wlogprint("Invalid selection\n");
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
@ -1891,7 +1891,7 @@ retry:
|
|||||||
gpu_devices[selected] = false;
|
gpu_devices[selected] = false;
|
||||||
} else if (!strncasecmp(&input, "r", 1)) {
|
} else if (!strncasecmp(&input, "r", 1)) {
|
||||||
selected = curses_int("Select GPU to attempt to restart");
|
selected = curses_int("Select GPU to attempt to restart");
|
||||||
if (selected < 0 || selected > nDevs) {
|
if (selected < 0 || selected >= nDevs) {
|
||||||
wlogprint("Invalid selection\n");
|
wlogprint("Invalid selection\n");
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user