This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 97d7fbe8471674573897a32bfcbfd6a8f4fb9b2d
Author: Christopher Collins <ccoll...@apache.org>
AuthorDate: Sat Jun 13 11:06:05 2020 -0700

    base64: style fixes
---
 encoding/base64/src/base64.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/encoding/base64/src/base64.c b/encoding/base64/src/base64.c
index d36d4f0..5177121 100644
--- a/encoding/base64/src/base64.c
+++ b/encoding/base64/src/base64.c
@@ -131,19 +131,26 @@ token_decode(const char *token, int len)
     int i;
     unsigned int val = 0;
     int marker = 0;
-    if (len < 4)
+
+    if (len < 4) {
         return DECODE_ERROR;
+    }
+
     for (i = 0; i < 4; i++) {
         val *= 64;
-        if (token[i] == '=')
+        if (token[i] == '=') {
             marker++;
-        else if (marker > 0)
+        } else if (marker > 0) {
             return DECODE_ERROR;
-        else
+        } else {
             val += pos(token[i]);
+        }
     }
-    if (marker > 2)
+
+    if (marker > 2) {
         return DECODE_ERROR;
+    }
+
     return (marker << 24) | val;
 }
 

Reply via email to