From ee535eeaf6cbc6292bfaffe831f4798d63dc3ea3 Mon Sep 17 00:00:00 2001 From: covener Date: Tue, 28 Jun 2022 13:39:11 +0000 Subject: more whitespace git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902321 13f79535-47bb-0310-9956-ffa450edef68 --- encoding/apr_base64.c | 56 +++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/encoding/apr_base64.c b/encoding/apr_base64.c index 45ea4fe60..ab200cd7e 100644 --- a/encoding/apr_base64.c +++ b/encoding/apr_base64.c @@ -168,24 +168,24 @@ APR_DECLARE(int) apr_base64_decode_binary(unsigned char *bufplain, bufin = (const unsigned char *) bufcoded; while (nprbytes >= 4) { - *(bufout++) = - (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); - *(bufout++) = - (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); - *(bufout++) = - (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); - bufin += 4; - nprbytes -= 4; + *(bufout++) = + (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); + *(bufout++) = + (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); + *(bufout++) = + (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]); + bufin += 4; + nprbytes -= 4; } /* Note: (nprbytes == 1) would be an error, so just ignore that case */ if (nprbytes > 1) { - *(bufout++) = - (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); + *(bufout++) = + (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4); } if (nprbytes > 2) { - *(bufout++) = - (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); + *(bufout++) = + (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2); } return nbytesdecoded - (int)((4u - nprbytes) & 3u); @@ -223,26 +223,26 @@ APR_DECLARE(int) apr_base64_encode(char *encoded, const char *string, int len) p = encoded; for (i = 0; i < len - 2; i += 3) { - *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F]; - *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) | - ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)]; - *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2) | - ((int) (os_toascii[string[i + 2]] & 0xC0) >> 6)]; - *p++ = basis_64[os_toascii[string[i + 2]] & 0x3F]; + *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F]; + *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) | + ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)]; + *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2) | + ((int) (os_toascii[string[i + 2]] & 0xC0) >> 6)]; + *p++ = basis_64[os_toascii[string[i + 2]] & 0x3F]; } if (i < len) { - *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F]; - if (i == (len - 1)) { - *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4)]; + *p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F]; + if (i == (len - 1)) { + *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4)]; + *p++ = '='; + } + else { + *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) | + ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)]; + *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2)]; + } *p++ = '='; } - else { - *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) | - ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)]; - *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2)]; - } - *p++ = '='; - } *p++ = '\0'; return (unsigned int)(p - encoded); -- cgit v1.2.1