Skip to content

Commit c69a0cc

Browse files
authored
Fix edge case in findDelimiter (#7911)
#changelog #addon #networking
1 parent cd21c01 commit c69a0cc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

addons/ofxNetwork/src/ofxTCPClient.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ static int findDelimiter(char * data, int size, string delimiter){
283283
posInDelimiter++;
284284
if(posInDelimiter==delimiter.size()) return i-delimiter.size()+1;
285285
}else{
286+
if(posInDelimiter>0){
287+
// Stay at the same position to try matching again
288+
i--;
289+
}
286290
posInDelimiter=0;
287291
}
288292
}

0 commit comments

Comments
 (0)