base64: Adjust whitespace for readability

Change-Id: Ibf72dddceac925521a0fec3ab0bed7ed360e7c06
Reviewed-on: https://code.wireshark.org/review/25547
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Stig Bjørlykke 2018-02-01 15:09:22 +01:00 committed by Michael Mann
parent 3f93c6e799
commit d25e7885e6
1 changed files with 10 additions and 10 deletions

View File

@ -26,22 +26,22 @@ size_t ws_base64_decode_inplace(char *s)
int cr_idx;
/* we will allow CR and LF - but ignore them */
cr_idx = (int) (strchr(b64, '\r') - b64);
cr_idx = (int)(strchr(b64, '\r') - b64);
i = 0;
while (*s && (p=strchr(b64, *s))) {
while (*s && (p = strchr(b64, *s))) {
idx = (int)(p - b64);
if(idx < cr_idx) {
byte_offset = (i*6)/8;
bit_offset = (i*6)%8;
d[byte_offset] &= ~((1<<(8-bit_offset))-1);
if (idx < cr_idx) {
byte_offset = (i * 6) / 8;
bit_offset = (i * 6) % 8;
d[byte_offset] &= ~((1 << (8 - bit_offset)) - 1);
if (bit_offset < 3) {
d[byte_offset] |= (idx << (2-bit_offset));
d[byte_offset] |= (idx << (2 - bit_offset));
} else {
d[byte_offset] |= (idx >> (bit_offset-2));
d[byte_offset+1] = 0;
d[byte_offset+1] |= (idx << (8-(bit_offset-2))) & 0xFF;
d[byte_offset] |= (idx >> (bit_offset - 2));
d[byte_offset + 1] = 0;
d[byte_offset + 1] |= (idx << (8 - (bit_offset - 2))) & 0xFF;
}
i++;
}