summaryrefslogtreecommitdiff
path: root/plugins/JSON/Source/JSON_Base64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/JSON/Source/JSON_Base64.cpp')
-rw-r--r--plugins/JSON/Source/JSON_Base64.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/JSON/Source/JSON_Base64.cpp b/plugins/JSON/Source/JSON_Base64.cpp
index fcde330b1a..fdf7930208 100644
--- a/plugins/JSON/Source/JSON_Base64.cpp
+++ b/plugins/JSON/Source/JSON_Base64.cpp
@@ -50,13 +50,13 @@ json_string JSONBase64::json_encode64(const unsigned char * binary, size_t bytes
}
inline json_char toBinary(json_char c){
- if (c == JSON_TEXT('+')){
+ if (c == JSON_TEXT('+')) {
return JSON_TEXT('>');
- } else if (c == JSON_TEXT('/')){
+ } else if (c == JSON_TEXT('/')) {
return JSON_TEXT('?');
- } else if (c < JSON_TEXT(':')){
+ } else if (c < JSON_TEXT(':')) {
return c + JSON_TEXT('\x04');
- } else if (c < JSON_TEXT('[')){
+ } else if (c < JSON_TEXT('[')) {
return c - JSON_TEXT('\x41');
}
return c - 71;
@@ -97,10 +97,10 @@ std::string JSONBase64::json_decode64(const json_string & encoded){
//now do the ones that might have padding, the first two characters can not be padding, so do them quickly
const char second = toBinary(runner[1]);
result += (toBinary(runner[0]) << 2) + ((second & 0x30) >> 4);
- if (runner[2] != '='){ //not two = pads
+ if (runner[2] != '=') { //not two = pads
const char third = toBinary(runner[2]);
result += ((second & 0xf) << 4) + ((third & 0x3c) >> 2);
- if (runner[3] != '='){ //no padding
+ if (runner[3] != '=') { //no padding
result += ((third & 0x3) << 6) + toBinary(runner[3]);
}
}