From c2e4302581f04c62fa4d4f2e4582d4ee6deb4c25 Mon Sep 17 00:00:00 2001 From: Jonathan Bendes Date: Tue, 22 Oct 2024 17:29:14 -0400 Subject: [PATCH] Ignoring 0 presses when invalid input --- tools/cpp/spy-lite/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cpp/spy-lite/main.cpp b/tools/cpp/spy-lite/main.cpp index 45272928..bbf80ba2 100644 --- a/tools/cpp/spy-lite/main.cpp +++ b/tools/cpp/spy-lite/main.cpp @@ -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(); @@ -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