fix firstColon on last position
This commit is contained in:
parent
1ceaf159ba
commit
6b1d319901
|
|
@ -177,7 +177,7 @@ namespace APRS_IS_Utils {
|
||||||
if (packet != "") {
|
if (packet != "") {
|
||||||
if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("RFONLY") == -1)) {
|
if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("RFONLY") == -1)) {
|
||||||
int firstColonIndex = packet.indexOf(":");
|
int firstColonIndex = packet.indexOf(":");
|
||||||
if (firstColonIndex > 0 && packet[firstColonIndex + 1] != '}' && packet.indexOf("TCPIP") == -1) {
|
if (firstColonIndex > 0 && firstColonIndex < packet.length() && packet[firstColonIndex + 1] != '}' && packet.indexOf("TCPIP") == -1) {
|
||||||
const String& Sender = packet.substring(3, packet.indexOf(">"));
|
const String& Sender = packet.substring(3, packet.indexOf(">"));
|
||||||
if (Sender != Config.callsign && Utils::checkValidCallsign(Sender)) {
|
if (Sender != Config.callsign && Utils::checkValidCallsign(Sender)) {
|
||||||
STATION_Utils::updateLastHeard(Sender);
|
STATION_Utils::updateLastHeard(Sender);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ namespace DIGI_Utils {
|
||||||
bool thirdPartyPacket = false;
|
bool thirdPartyPacket = false;
|
||||||
String temp, Sender;
|
String temp, Sender;
|
||||||
int firstColonIndex = packet.indexOf(":");
|
int firstColonIndex = packet.indexOf(":");
|
||||||
if (firstColonIndex > 0 && packet[firstColonIndex + 1] == '}' && packet.indexOf("TCPIP") > 0) { // 3rd Party
|
if (firstColonIndex > 0 && firstColonIndex < packet.length() && packet[firstColonIndex + 1] == '}' && packet.indexOf("TCPIP") > 0) { // 3rd Party
|
||||||
thirdPartyPacket = true;
|
thirdPartyPacket = true;
|
||||||
temp = packet.substring(packet.indexOf(":}") + 2);
|
temp = packet.substring(packet.indexOf(":}") + 2);
|
||||||
Sender = temp.substring(0, temp.indexOf(">"));
|
Sender = temp.substring(0, temp.indexOf(">"));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue