diff options
Diffstat (limited to 'Swiften/SASL')
-rw-r--r-- | Swiften/SASL/DIGESTMD5Properties.cpp | 4 | ||||
-rw-r--r-- | Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Swiften/SASL/DIGESTMD5Properties.cpp b/Swiften/SASL/DIGESTMD5Properties.cpp index baf0197..1f33c8f 100644 --- a/Swiften/SASL/DIGESTMD5Properties.cpp +++ b/Swiften/SASL/DIGESTMD5Properties.cpp @@ -48,8 +48,8 @@ DIGESTMD5Properties DIGESTMD5Properties::parse(const ByteArray& data) { bool inKey = true; ByteArray currentKey; ByteArray currentValue; - for (size_t i = 0; i < data.size(); ++i) { - char c = static_cast<char>(data[i]); + for (unsigned char i : data) { + char c = static_cast<char>(i); if (inKey) { if (c == '=') { inKey = false; diff --git a/Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp b/Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp index 2374d15..3c00402 100644 --- a/Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp +++ b/Swiften/SASL/SCRAMSHA1ClientAuthenticator.cpp @@ -21,15 +21,15 @@ namespace Swift { static std::string escape(const std::string& s) { std::string result; - for (size_t i = 0; i < s.size(); ++i) { - if (s[i] == ',') { + for (char i : s) { + if (i == ',') { result += "=2C"; } - else if (s[i] == '=') { + else if (i == '=') { result += "=3D"; } else { - result += s[i]; + result += i; } } return result; |