From 346f40920bc039bdb8082b87b3f17978bb8670a4 Mon Sep 17 00:00:00 2001 From: vlad Date: Mon, 24 Jan 2022 20:02:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BF=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BC=D0=B0=D1=81=D1=81=D0=B8=D0=B2=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20explicit=20=D1=81=D0=BE=D0=BE?= =?UTF-8?q?=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MessageDecoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MessageDecoder.cpp b/src/MessageDecoder.cpp index 92dab62..72e5c55 100644 --- a/src/MessageDecoder.cpp +++ b/src/MessageDecoder.cpp @@ -159,11 +159,11 @@ static std::string buildExplicitMessageFrame(const MessageStruct& msg) { headerLen = 2; } - MessageStruct tmpMsg = msg; + MessageStruct tmpMsg(msg); if (tmpMsg.dataLen >= headerLen) { // убираем первый байт, чтобы посылка была tmpMsg.dataLen -= headerLen; - for (int i = 0; i < tmpMsg.dataLen - headerLen; i++) { + for (int i = 0; i < tmpMsg.dataLen; i++) { tmpMsg.data[i] = tmpMsg.data[i + headerLen]; } } else {