fixed bug: number_parse did not update buf->cursor

This commit is contained in:
Juri Glass 2011-07-13 18:00:05 +02:00
parent 554b871f2f
commit c6942f329b
2 changed files with 2 additions and 0 deletions

View file

@ -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;
}

View file

@ -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) {