summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 4fd118b2..9d471db3 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -214,7 +214,13 @@ public:
auto cp = key.codepoint();
if (cp and isdigit(*cp))
- m_params.count = m_params.count * 10 + *cp - '0';
+ {
+ int new_val = m_params.count * 10 + *cp - '0';
+ if (new_val < 0)
+ context().print_status({ "parameter overflowed", get_face("Error") });
+ else
+ m_params.count = new_val;
+ }
else if (key == Key::Backspace)
m_params.count /= 10;
else if (key == '\\')