proto_trxd: Fix UndefinedBehaviorSanitizer from ubsan

From UBSan:
proto_trxd.c:65:18: runtime error: 128 is outside the range of representable values of type 'char'.

Fixes: OS#4507
Change-Id: I71f815fe794a00934ee0e876848af56f30a21bfe
This commit is contained in:
Pau Espin 2020-06-19 18:31:02 +02:00
parent 174fb03b8e
commit b536ab9bdf
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ static void trxd_fill_burst_normalized255(uint8_t* soft_bits, const struct trx_u
{
unsigned i;
for (i = 0; i < bi->nbits; i++)
soft_bits[i] = (char) round(bi->rx_burst[i] * 255.0);
soft_bits[i] = (uint8_t) round(bi->rx_burst[i] * 255.0);
}
bool trxd_send_burst_ind_v0(size_t chan, int fd, const struct trx_ul_burst_ind *bi) {