From 4b9987b1190e38114fb4877279707ad7efb40776 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 14 Nov 2017 20:42:41 -0500 Subject: [PATCH] Fix '0' being interpreted as a count prefix instead of a command --- src/core/CommandMap.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/CommandMap.cc b/src/core/CommandMap.cc index 7bac182..420a94e 100644 --- a/src/core/CommandMap.cc +++ b/src/core/CommandMap.cc @@ -72,7 +72,9 @@ uint8_t CommandMap::scan_units( for (size_t i = 0u; i < length; i++) { uint32_t c = command_characters[i]; - if (gathering_count && ('0' <= c) && (c <= '9')) + if (gathering_count && + ((('1' <= c) && (c <= '9')) || + ((c == '0') && (unit.count != 0u)))) { unit.count *= 10u; unit.count += (c - '0');