Skip to content

Commit

Permalink
decode_base64: Allow '=' padding character
Browse files Browse the repository at this point in the history
'=' is a valid character, but minetest.decode_base64 returned nil when it was used for padding.
  • Loading branch information
SmallJoker committed Jul 29, 2020
1 parent 3ce03d1 commit f34abae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/util/base64.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit f34abae

Please sign in to comment.