diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 5d5078cc2e9..7a072171e0b 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -98,14 +98,16 @@ void encode16bit(int const& n, uint8_t& low, uint8_t& up) if (n >= (1 << 16)) { low = up = -1; return; + } else { + low = up = 0; } - int bbyte = 8; - for (int b{0}; b < bbyte; ++b) { - int bl = (n & (1 << b)) >> b; - int bu = (n & (1 << (b + bbyte))) >> (b + bbyte); - if (bl > 0) + int bByte = 8; + for (int b{0}; b < bByte; ++b) { + int bL = (n & (1 << b)) >> b; + int bU = (n & (1 << (b + bByte))) >> (b + bByte); + if (bL > 0) low += (1 << b); - if (bu > 0) + if (bU > 0) up += (1 << b); } }