Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignoring 0 presses when invalid input #495

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading