memset takes an int and converts it to unsigned char, so this masking should be unnecessary.
True, I ended up adding this because one of our static analyzers complained about a suspicious integer being passed to memset. I can fix it locally only if it's preferred, though.
On the second thought, this is good for readability. LGTM