Skip to content

Commit f08494a

Browse files
committed
Preserve the data pointer
1 parent 9890a64 commit f08494a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/SparkFun_Extensible_Message_Parser.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,12 @@ void sempParseNextByte(SEMP_PARSE_STATE *parse, uint8_t data)
397397
// Parse the next bytes
398398
void sempParseNextBytes(SEMP_PARSE_STATE *parse, uint8_t *data, uint16_t len)
399399
{
400+
uint8_t *ptr = data;
400401
for (uint16_t i = 0; i < len; i++)
401-
sempParseNextByte(parse, *(data++));
402+
{
403+
sempParseNextByte(parse, *ptr);
404+
ptr++;
405+
}
402406
}
403407

404408
// Shutdown the parser

0 commit comments

Comments
 (0)