Skip to content

Commit

Permalink
Ignoring 0 presses when invalid input
Browse files Browse the repository at this point in the history
  • Loading branch information
jbendes committed Oct 22, 2024
1 parent 356384f commit c2e4302
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 c2e4302

Please sign in to comment.