From f34abaedd2b9277c1862cd9b82ca3338747f104e Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Wed, 29 Jul 2020 20:46:36 +0200 Subject: decode_base64: Allow '=' padding character '=' is a valid character, but minetest.decode_base64 returned nil when it was used for padding. --- src/util/base64.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3