Avoid an MSVC warning in sodium_base64_ENCODED_LEN macro

Reported by @valveri , thanks!

Fixes #1526
Fixes #1527
This commit is contained in:
Frank Denis
2026-03-24 19:39:47 +08:00
parent 79a59b7a0a
commit cdd5dea03d
+1 -1
View File
@@ -77,7 +77,7 @@ int sodium_hex2bin(unsigned char *const bin, const size_t bin_maxlen, const char
#define sodium_base64_ENCODED_LEN(BIN_LEN, VARIANT) \
(((BIN_LEN) / 3U) * 4U + \
((((BIN_LEN) - ((BIN_LEN) / 3U) * 3U) | (((BIN_LEN) - ((BIN_LEN) / 3U) * 3U) >> 1)) & 1U) * \
(4U - (~((((VARIANT) & 2U) >> 1) - 1U) & (3U - ((BIN_LEN) - ((BIN_LEN) / 3U) * 3U)))) + \
(4U - ((0U - (((VARIANT) & 2U) >> 1)) & (3U - ((BIN_LEN) - ((BIN_LEN) / 3U) * 3U)))) + \
1U)
SODIUM_EXPORT