Fix '0' being interpreted as a count prefix instead of a command
This commit is contained in:
parent
c2b50a3f4f
commit
4b9987b119
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user