From ccc744ec01beccbcdab8e1fd0198bf8dd0b03e6f Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Thu, 20 Jan 2022 12:55:53 +0100 Subject: [PATCH] Expect a space between Talkgroup and its number. --- P25Gateway/P25Gateway.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/P25Gateway/P25Gateway.cpp b/P25Gateway/P25Gateway.cpp index 225967b..9dd4a3e 100644 --- a/P25Gateway/P25Gateway.cpp +++ b/P25Gateway/P25Gateway.cpp @@ -449,7 +449,7 @@ void CP25Gateway::run() if (res > 0) { buffer[res] = '\0'; if (::memcmp(buffer + 0U, "TalkGroup", 9U) == 0) { - unsigned int tg = (unsigned int)::atoi((char*)(buffer + 9U)); + unsigned int tg = ((strlen((char*)buffer + 0U) > 10) ? (unsigned int)::atoi((char*)(buffer + 10U)) : 9999); if (tg != currentTG) { if (currentAddrLen > 0U) {