Skip to content
Snippets Groups Projects
Commit c43cca3f authored by Kristof Szabados's avatar Kristof Szabados
Browse files

bit_limit needs to be known only after the condition.


Signed-off-by: default avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent b9c779d1
No related branches found
No related tags found
No related merge requests found
......@@ -1343,8 +1343,8 @@ unsigned char TTCN_Buffer::get_byte_rev(const unsigned char* data,
{
unsigned char ch='\0';
size_t hossz=(len+7)/8-1;
int bit_limit=len%8;
if(idx>hossz) return ch;
const int bit_limit=len%8;
if(bit_limit==0)return data[hossz-idx];
ch=data[hossz-idx]<<(8-bit_limit);
if((hossz-idx)>0) ch|=(data[hossz-idx-1]>>bit_limit)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment