diff --git a/libs/libc/net/lib_base64.c b/libs/libc/net/lib_base64.c index 97e360212d..28a158d3f6 100644 --- a/libs/libc/net/lib_base64.c +++ b/libs/libc/net/lib_base64.c @@ -66,20 +66,20 @@ int b64_ntop(FAR const unsigned char *src, size_t srclen, return -1; } - *target++ = g_base64[src[0] >> 2]; - if (srclen == 1) - { - *target++ = g_base64[(src[0] & 0x03) << 4]; - *target++ = g_pad64; - } - else - { - *target++ = g_base64[((src[0] & 0x03) << 4) + (src[1] >> 4)]; - *target++ = g_base64[(src[1] & 0x0f) << 2]; - } + *target++ = g_base64[src[0] >> 2]; + if (srclen == 1) + { + *target++ = g_base64[(src[0] & 0x03) << 4]; + *target++ = g_pad64; + } + else + { + *target++ = g_base64[((src[0] & 0x03) << 4) + (src[1] >> 4)]; + *target++ = g_base64[(src[1] & 0x0f) << 2]; + } - *target++ = g_pad64; - } + *target++ = g_pad64; + } *target = '\0'; return datalen;