From b6bc2c9564306c333c40e37256a0907d14834d94 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 26 Feb 2006 11:53:38 +0000 Subject: [PATCH] bug fix --- src/protocol.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/protocol.cpp b/src/protocol.cpp index 5917ed41..c76c3ba5 100755 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -102,11 +102,12 @@ qDebug ( "parser entered" ); // convert unsigned char in uint8_t, TODO convert all buffers in uint8_t -CVector vecbyDataConv ( vecbyData.Size () ); -for ( int i = 0; i < vecbyData.Size (); i++ ) { +CVector vecbyDataConv ( iNumBytes ); +for ( int i = 0; i < iNumBytes; i++ ) { vecbyDataConv[i] = static_cast ( vecbyData[i] ); } +// important: vecbyDataConv must have iNumBytes to get it work!!! if ( ParseMessageFrame ( vecbyDataConv, iRecCounter, iRecID, vecData ) ) { @@ -195,6 +196,11 @@ qDebug ( "min length ok" ); iLenBy = static_cast ( GetValFromStream ( vecIn, iCurPos, 2 ) ); // make sure the length is correct + + +qDebug ( "iLenBy: %d / iVecInLenByte: %d" ); + + if ( iLenBy != iVecInLenByte - MESS_LEN_WITHOUT_DATA_BYTE ) { return false; // return error code