Commit 2f9c99e8 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Make masking more clear in mask_prefix.

parent 8ee8d193
......@@ -210,7 +210,8 @@ mask_prefix(unsigned char *restrict ret,
memset(ret, 0, 16);
memcpy(ret, prefix, plen / 8);
if(plen % 8 != 0)
ret[plen / 8] = (prefix[plen / 8] & (0xFF << (8 - (plen % 8))));
ret[plen / 8] =
(prefix[plen / 8] & ((0xFF << (8 - (plen % 8))) & 0xFF));
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment