diff --git a/src/bfcp/attr.c b/src/bfcp/attr.c index 7607fe066..7b05f71cb 100644 --- a/src/bfcp/attr.c +++ b/src/bfcp/attr.c @@ -64,7 +64,8 @@ static int attr_encode(struct mbuf *mb, bool mand, enum bfcp_attrib type, const struct bfcp_supprim *supprim = v; const enum bfcp_priority *priority = v; const uint16_t *u16 = v; - size_t start, len, i; + size_t start, i; + uint8_t len; int err; start = mb->pos; @@ -124,7 +125,7 @@ static int attr_encode(struct mbuf *mb, bool mand, enum bfcp_attrib type, } /* header */ - len = mb->pos - start; + len = (uint8_t)(mb->pos - start); mb->pos = start; err |= mbuf_write_u8(mb, (type<<1) | (mand ? 1 : 0));