Skip to content

Commit

Permalink
fix array out of bounds on regular m chip
Browse files Browse the repository at this point in the history
  • Loading branch information
masiboss committed Dec 7, 2023
1 parent aeefcac commit bcf4ad8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/osx/btop_collect.cpp
Expand Up @@ -229,7 +229,7 @@ namespace Cpu {
name.clear();
} else if (v_contains(name_vec, "Apple"s)) {
auto apple_pos = v_index(name_vec, "Apple"s);
name = (apple_pos < name_vec.size() - 1 ? name_vec.at(apple_pos + 1) : "") + ' ' + (apple_pos < name_vec.size() - 1 ? name_vec.at(apple_pos + 2) : "");
name = (apple_pos < name_vec.size() - 1 ? name_vec.at(apple_pos + 1) : "") + (apple_pos < name_vec.size() - 1 && name_vec.size() > 2 ? ' ' + name_vec.at(apple_pos + 2) : "");
} else
name.clear();

Expand Down

0 comments on commit bcf4ad8

Please sign in to comment.