mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Berry fix bytes getter for 3-bytes big-endian (#19945)
This commit is contained in:
parent
4e8e01fd62
commit
ceda8782c8
@ -364,7 +364,7 @@ static uint32_t buf_get3_le(buf_impl* attr, size_t offset)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint16_t buf_get3_be(buf_impl* attr, size_t offset)
|
static uint32_t buf_get3_be(buf_impl* attr, size_t offset)
|
||||||
{
|
{
|
||||||
if ((int32_t)offset + 2 < attr->len) {
|
if ((int32_t)offset + 2 < attr->len) {
|
||||||
return attr->bufptr[offset+2] | (attr->bufptr[offset+1] << 8) | (attr->bufptr[offset] << 16);
|
return attr->bufptr[offset+2] | (attr->bufptr[offset+1] << 8) | (attr->bufptr[offset] << 16);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user