]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/util/base64.cpp
Change typedef to normal definitions in GUI code
[dragonfireclient.git] / src / util / base64.cpp
index e14de7de28d291a00f69b2a8af12eba5163a7e5e..6e15844105de65e401af0bc8b1f6b33b2292cbe3 100644 (file)
@@ -34,14 +34,16 @@ 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)
 {
-       for(size_t i=0; i<s.size(); i++)
-               if(!is_base64(s[i])) return false;
+       for (char i : s)
+               if (!is_base64(i))
+                       return false;
        return true;
 }