We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49f661d commit 042b574Copy full SHA for 042b574
src/transport/common/rx.c
@@ -24,12 +24,12 @@
24
25
/*------------------ Reception helper ------------------*/
26
size_t _z_read_stream_size(_z_zbuf_t *zbuf) {
27
- size_t stream_size = 0;
+ uint8_t stream_size[_Z_MSG_LEN_ENC_SIZE];
28
// Read the bytes from stream
29
for (uint8_t i = 0; i < _Z_MSG_LEN_ENC_SIZE; i++) {
30
- stream_size += (size_t)_z_zbuf_read(zbuf) << (8 * i);
+ stream_size[i] = _z_zbuf_read(zbuf);
31
}
32
- return stream_size;
+ return _z_host_le_load16(stream_size);
33
34
35
int8_t _z_link_recv_t_msg(_z_transport_message_t *t_msg, const _z_link_t *zl) {
0 commit comments