From 91eccac90c5257243aa8de35af17b7bb92179fb6 Mon Sep 17 00:00:00 2001 From: hb9tob Date: Thu, 13 Apr 2023 21:22:51 +0200 Subject: [PATCH] fix 991a shame 2 --- YSFGateway/WiresX.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/YSFGateway/WiresX.cpp b/YSFGateway/WiresX.cpp index aa92096..247564a 100644 --- a/YSFGateway/WiresX.cpp +++ b/YSFGateway/WiresX.cpp @@ -836,7 +836,7 @@ void CWiresX::sendAllReply() unsigned int n = curr.size() - m_start; if (n > 20U) n = 20U; - ::sprintf((char*)(data + 22U), "%03u%03u", n, total); + ::sprintf((char*)(data + 22U), "%03u%03u", 20U, total); data[28U] = 0x0DU; @@ -868,7 +868,16 @@ void CWiresX::sendAllReply() unsigned int k = 1029U - offset; for(unsigned int i = 0U; i < k; i++) - data[i + offset] = 0x20U; + { + if (i % 50U == 49 && i>0) + { + data[i + offset] = 0x0DU; + } + else + { + data[i + offset] = 0x20U; + } + } offset += k; @@ -1035,7 +1044,7 @@ void CWiresX::sendCategoryReply() if (n > 20U) n = 20U; - ::sprintf((char*)(data + 22U), "%03u%03u", n, n); + ::sprintf((char*)(data + 22U), "%03u%03u", 20U, n); data[28U] = 0x0DU; @@ -1067,7 +1076,16 @@ void CWiresX::sendCategoryReply() unsigned int k = 1029U - offset; for(unsigned int i = 0U; i < k; i++) - data[i + offset] = 0x20U; + { + if (i % 50U == 49 && i>0) + { + data[i + offset] = 0x0DU; + } + else + { + data[i + offset] = 0x20U; + } + } offset += k;