diff options
author | SmallJoker <mk939@ymail.com> | 2020-07-29 20:46:36 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2020-07-29 20:46:42 +0200 |
commit | f34abaedd2b9277c1862cd9b82ca3338747f104e (patch) | |
tree | eabb08f044421f732797d4f8d72d8ebade1dc6e7 /src/util | |
parent | 3ce03d1c2a63d261c83f5962cd13212697f19472 (diff) | |
download | minetest-f34abaedd2b9277c1862cd9b82ca3338747f104e.tar.gz minetest-f34abaedd2b9277c1862cd9b82ca3338747f104e.tar.bz2 minetest-f34abaedd2b9277c1862cd9b82ca3338747f104e.zip |
decode_base64: Allow '=' padding character
'=' is a valid character, but minetest.decode_base64 returned nil when it was used for padding.
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/base64.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/base64.cpp b/src/util/base64.cpp index c75f98598..6e1584410 100644 --- a/src/util/base64.cpp +++ b/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) |