Skip to content

Commit

Permalink
Merge pull request #495 from ZeroCM/spy-bug
Browse files Browse the repository at this point in the history
Ignoring 0 presses when invalid input
  • Loading branch information
jbendes authored Oct 22, 2024
2 parents 356384f + c2e4302 commit 8aa3ef4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/cpp/spy-lite/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ struct SpyInfo
view_id += (ch - '0');
}
} else if (ch == '\n') {
if (view_id >= 0) {
if (view_id > 0) {
// set and increase sub-msg decoding depth
minfo.incViewDepth(view_id, decode_prefix_filter);
decode_prefix_filter.clear();
Expand Down Expand Up @@ -331,7 +331,7 @@ struct SpyInfo
(ch == '_') || (ch == '/')) {
is_setting_decode_prefix = true;
return handleKeyboardDecodeSettingPrefix(ch);
} else if ('0' <= ch && ch <= '9') {
} else if ('0' < ch && ch <= '9') {
// shortcut for single digit channels
view_id = ch - '0';
// set and increase sub-msg decoding depth
Expand Down

0 comments on commit 8aa3ef4

Please sign in to comment.