From 88a19fa7ec14b90a37b67f0c38c25996312f6990 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Sun, 5 Dec 2021 20:08:39 -0700 Subject: [PATCH] CBuffer.Set(uint8_t) sets a trailing null --- reflector/M17Protocol.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/reflector/M17Protocol.cpp b/reflector/M17Protocol.cpp index b5a5415..9ee8884 100644 --- a/reflector/M17Protocol.cpp +++ b/reflector/M17Protocol.cpp @@ -88,8 +88,7 @@ void CM17Protocol::Task(void) if ( g_Reflector.IsValidModule(ToLinkModule) ) { // acknowledge the request - Buffer.Set("ACKN"); - Send(Buffer, Ip); + Send("ACKN", Ip); // create the client and append g_Reflector.GetClients()->AddClient(std::make_shared(Callsign, Ip, ToLinkModule)); @@ -100,15 +99,13 @@ void CM17Protocol::Task(void) std::cout << "M17 node " << Callsign << " connect attempt on non-existing module" << std::endl; // deny the request - Buffer.Set("NACK"); - Send(Buffer, Ip); + Send("NACK", Ip); } } else { // deny the request - Buffer.Set("NACK"); - Send(Buffer, Ip); + Send("NACK", Ip); } } @@ -124,8 +121,7 @@ void CM17Protocol::Task(void) // remove it clients->RemoveClient(client); // and acknowledge the disconnect - Buffer.Set("DISC"); - Send(Buffer, Ip); + Send("DISC", Ip); } g_Reflector.ReleaseClients(); }