aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2020-07-29 20:46:36 +0200
committerSmallJoker <mk939@ymail.com>2020-07-29 20:46:42 +0200
commitf34abaedd2b9277c1862cd9b82ca3338747f104e (patch)
treeeabb08f044421f732797d4f8d72d8ebade1dc6e7 /src/util
parent3ce03d1c2a63d261c83f5962cd13212697f19472 (diff)
downloadminetest-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.cpp5
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)