Skip to content

Commit

Permalink
bug fix for for (unsigned int i; i < frame.data.size(); i++)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvtom committed Jun 8, 2022
1 parent 170d775 commit d397403
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions RscpMqttMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ int handleResponseValue(RscpProtocol *protocol, SRscpValue *response) {
static int processReceiveBuffer(const unsigned char * ucBuffer, int iLength){
RscpProtocol protocol;
SRscpFrame frame;
int i;

int iResult = protocol.parseFrame(ucBuffer, iLength, &frame);

Expand All @@ -289,17 +290,15 @@ static int processReceiveBuffer(const unsigned char * ucBuffer, int iLength){
return(iResult);
}

int iProcessedBytes = iResult;

// process each SRscpValue struct seperately
for (unsigned int i; i < frame.data.size(); i++)
for (i = 0; i < frame.data.size(); i++)
handleResponseValue(&protocol, &frame.data[i]);

// destroy frame data and free memory
protocol.destroyFrameData(frame);

// returned processed amount of bytes
return(iProcessedBytes);
return(iResult);
}

static void receiveLoop(bool & bStopExecution){
Expand Down

0 comments on commit d397403

Please sign in to comment.