1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 13:21:23 +01:00

Allow negative route ids.

This commit is contained in:
Asbelos 2022-04-18 16:46:13 +01:00
parent 920fcbc095
commit 64cae26333

View File

@ -255,10 +255,13 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) {
int WiThrottle::getInt(byte * cmd) { int WiThrottle::getInt(byte * cmd) {
int i=0; int i=0;
bool negate=cmd[0]=='-';
if (negate) cmd++;
while (cmd[0]>='0' && cmd[0]<='9') { while (cmd[0]>='0' && cmd[0]<='9') {
i=i*10 + (cmd[0]-'0'); i=i*10 + (cmd[0]-'0');
cmd++; cmd++;
} }
if (negate) i=0-i;
return i ; return i ;
} }