diff --git a/src/WiThrottleProtocol.cpp b/src/WiThrottleProtocol.cpp index cc81d71..1f2de60 100644 --- a/src/WiThrottleProtocol.cpp +++ b/src/WiThrottleProtocol.cpp @@ -515,7 +515,7 @@ bool WiThrottleProtocol::processCommand(char *c, int len) { else if (len > 8 && c[0]=='M' && c[2]=='L') { return processRosterFunctionList(c[1], c+3, len-3); } - else if (len > 5 && c[0]=='P' && c[1]=='T' && c[2]=='A') { + else if (len > 4 && c[0]=='P' && c[1]=='T' && c[2]=='A') { processTurnoutAction(c+3, len-3); return true; } @@ -1110,7 +1110,7 @@ void WiThrottleProtocol::processStealNeeded(char multiThrottle, char *c, int len void WiThrottleProtocol::processTurnoutAction(char *c, int len) { if (delegate) { String s(c); - String systemName = s.substring(1,s.length()-1); + String systemName = s.substring(1); TurnoutState state = TurnoutUnknown; if (c[0]=='2') { state = TurnoutClosed; @@ -1132,7 +1132,7 @@ void WiThrottleProtocol::processTurnoutAction(char *c, int len) { void WiThrottleProtocol::processRouteAction(char *c, int len) { if (delegate) { String s(c); - String systemName = s.substring(1,s.length()-1); + String systemName = s.substring(1); RouteState state = RouteInconsistent; if (c[0]=='2') { state = RouteActive;