Skip to content

Commit 042b574

Browse files
committed
fix: revert rx function change
1 parent 49f661d commit 042b574

File tree

1 file changed

+3
-3
lines changed
  • src/transport/common

1 file changed

+3
-3
lines changed

src/transport/common/rx.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424

2525
/*------------------ Reception helper ------------------*/
2626
size_t _z_read_stream_size(_z_zbuf_t *zbuf) {
27-
size_t stream_size = 0;
27+
uint8_t stream_size[_Z_MSG_LEN_ENC_SIZE];
2828
// Read the bytes from stream
2929
for (uint8_t i = 0; i < _Z_MSG_LEN_ENC_SIZE; i++) {
30-
stream_size += (size_t)_z_zbuf_read(zbuf) << (8 * i);
30+
stream_size[i] = _z_zbuf_read(zbuf);
3131
}
32-
return stream_size;
32+
return _z_host_le_load16(stream_size);
3333
}
3434

3535
int8_t _z_link_recv_t_msg(_z_transport_message_t *t_msg, const _z_link_t *zl) {

0 commit comments

Comments
 (0)