diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-06-19 18:31:02 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-06-19 18:31:05 +0200 |
commit | b536ab9bdf605298739bac82b496fbb35f40514a (patch) | |
tree | ea83eb1a2b70ef7ea11de4215c3a7f0c2a558c10 | |
parent | 174fb03b8ebb4524e233b44496fd01519e568262 (diff) |
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
-rw-r--r-- | Transceiver52M/proto_trxd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Transceiver52M/proto_trxd.c b/Transceiver52M/proto_trxd.c index 5a898b9..fbc0b14 100644 --- a/Transceiver52M/proto_trxd.c +++ b/Transceiver52M/proto_trxd.c @@ -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) { |