diff options
author | masiboss <32394683+masiboss@users.noreply.github.com> | 2023-12-07 20:56:40 +0100 |
---|---|---|
committer | masiboss <32394683+masiboss@users.noreply.github.com> | 2023-12-07 20:56:40 +0100 |
commit | 5beb9e12e5645e64644eb8465b097468172e244f (patch) | |
tree | 009d8c498eb07657f660b5d7ba089cac93a5cf10 | |
parent | 1b2f11b41234f7cdf83212c81cdbf086f491049d (diff) |
in case apple decides to add another suffix to the cpu name
-rw-r--r-- | src/osx/btop_collect.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/osx/btop_collect.cpp b/src/osx/btop_collect.cpp index a5408e2..9ad107c 100644 --- a/src/osx/btop_collect.cpp +++ b/src/osx/btop_collect.cpp @@ -229,7 +229,9 @@ 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.size() > 2 ? ' ' + 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) : "") + + (apple_pos < name_vec.size() - 1 && name_vec.size() > 3 ? ' ' + name_vec.at(apple_pos + 3) : ""); } else name.clear(); |