[router-advertisement] fix implicit conversion loss (#6559)

This commit is contained in:
Jonathan Hui
2021-05-03 22:50:55 -07:00
committed by GitHub
parent 9ae780091f
commit 54b01df89c
@@ -112,7 +112,7 @@ public:
* @param[in] aSize The size of the option in unit of 1 byte.
*
*/
void SetSize(uint16_t aSize) { mLength = (aSize + kLengthUnit - 1) / kLengthUnit; }
void SetSize(uint16_t aSize) { mLength = static_cast<uint8_t>((aSize + kLengthUnit - 1) / kLengthUnit); }
/**
* This method returns the size of the option (in bytes).