kopia lustrzana https://github.com/M17-Project/M17_Implementations
Fix undefined behaviour
rodzic
aada980987
commit
2059122c8f
|
@ -40,7 +40,7 @@ uint16_t SoftToInt(const uint16_t* in, uint8_t len)
|
|||
//result=a/b
|
||||
uint16_t Div16(uint16_t a, uint16_t b)
|
||||
{
|
||||
uint32_t aa=a<<16;
|
||||
uint32_t aa=(uint32_t)a<<16;
|
||||
uint32_t r=aa/b;
|
||||
|
||||
if(r<=0xFFFF)
|
||||
|
|
|
@ -162,7 +162,7 @@ uint32_t chainback(uint8_t* out, size_t pos, uint16_t len)
|
|||
|
||||
memset(out, 0, (len-1)/8+1);
|
||||
|
||||
while(bitPos > 0)
|
||||
while(pos > 0)
|
||||
{
|
||||
bitPos--;
|
||||
pos--;
|
||||
|
|
Ładowanie…
Reference in New Issue