Skip to content

Commit

Permalink
Fixed key > gpu_names check
Browse files Browse the repository at this point in the history
  • Loading branch information
aristocratos committed May 20, 2023
1 parent 04ed16a commit 2e68c0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/btop_input.cpp
Expand Up @@ -273,7 +273,7 @@ namespace Input {
atomic_wait(Runner::active);
Config::current_preset = -1;
auto key_i = std::stoi(key);
if (key_i-4u >= Gpu::gpu_names.size()) return;
if (std::cmp_greater(key_i-4, Gpu::gpu_names.size())) return;
Config::toggle_box(std::string("gpu") + (char)((key_i == 0 ? 10 : (key_i-5)) + '0'));
Draw::calcSizes();
Runner::run("all", false, true);
Expand Down

0 comments on commit 2e68c0b

Please sign in to comment.