decode_base64: Allow '=' padding character

'=' is a valid character, but minetest.decode_base64 returned nil when it was used for padding.
This commit is contained in:
SmallJoker 2020-07-29 20:46:36 +02:00
parent 3ce03d1c2a
commit f34abaedd2

@ -34,8 +34,9 @@ static const std::string base64_chars =
"0123456789+/";
static inline bool is_base64(unsigned char c) {
return (isalnum(c) || (c == '+') || (c == '/'));
static inline bool is_base64(unsigned char c)
{
return isalnum(c) || c == '+' || c == '/' || c == '=';
}
bool base64_is_valid(std::string const& s)