mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-27 04:07:12 +09:00
Avoid negations on unsigned values
This commit is contained in:
@@ -682,7 +682,7 @@ sodium_unpad(size_t *unpadded_buflen_p, const unsigned char *buf,
|
||||
is_barrier =
|
||||
(( (acc - 1U) & (pad_len - 1U) & ((c ^ 0x80) - 1U) ) >> 8) & 1U;
|
||||
acc |= c;
|
||||
pad_len |= (i & - is_barrier);
|
||||
pad_len |= i & (1U + ~is_barrier);
|
||||
valid |= (unsigned char) is_barrier;
|
||||
}
|
||||
*unpadded_buflen_p = padded_buflen - 1U - pad_len;
|
||||
|
||||
Reference in New Issue
Block a user