1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #11958 from miri64/emcute/fix/length-calculation

emcute: fix length field calculation
This commit is contained in:
Martine Lenders 2019-10-01 09:29:58 +02:00 committed by GitHub
commit aab312e8df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,9 @@ static volatile int result;
static size_t set_len(uint8_t *buf, size_t len)
{
if (len < (0xff - 7)) {
/* - `len` field minimum length == 1
* - `((len + 1) <= 0xff) == len < 0xff` */
if (len < 0xff) {
buf[0] = len + 1;
return 1;
}