fixed bug: number_parse did not update buf->cursor
This commit is contained in:
parent
554b871f2f
commit
c6942f329b
2 changed files with 2 additions and 0 deletions
|
@ -74,6 +74,7 @@ void *sml_number_parse(sml_buffer *buf, unsigned char type, int max_size) {
|
|||
if (!(sml_number_endian() == SML_BIG_ENDIAN)) {
|
||||
sml_number_byte_swap(np, max_size);
|
||||
}
|
||||
sml_buf_update_bytes_read(buf, l);
|
||||
|
||||
return np;
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ TEST(sml_number, parse_unsigned8) {
|
|||
hex2binary("6201", sml_buf_get_current_buf(buf));
|
||||
u8 *n = sml_u8_parse(buf);
|
||||
TEST_ASSERT_EQUAL(1, *n);
|
||||
TEST_ASSERT_EQUAL(2, buf->cursor);
|
||||
}
|
||||
|
||||
TEST(sml_number, parse_unsigned16) {
|
||||
|
|
Loading…
Add table
Reference in a new issue