Skip to content
Permalink
Browse files

decode_base64: Allow '=' padding character

'=' 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 f34abaedd2b9277c1862cd9b82ca3338747f104e
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/util/base64.cpp
@@ -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)

0 comments on commit f34abae

Please sign in to comment.
You can’t perform that action at this time.