1 if (slen-- == 0) {
2 break;
3 }
4 *o++ = base64_table_enc[*s >> 2];
5 st.carry = (*s++ << 4) & 0x30;
6 st.bytes++;
7 olen += 1;
8
9 // Deliberate fallthrough:
10 BASE64_FALLTHROUGH
11
12 case 1: if (slen-- == 0) {
13 break;
14 }
15 *o++ = base64_table_enc[st.carry | (*s >> 4)];
16 st.carry = (*s++ << 2) & 0x3C;
17 st.bytes++;
18 olen += 1;
19
20 // Deliberate fallthrough:
21 BASE64_FALLTHROUGH
22
23 case 2: if (slen-- == 0) {
24 break;
25 }
26 *o++ = base64_table_enc[st.carry | (*s >> 6)];
27 *o++ = base64_table_enc[*s++ & 0x3F];
28 st.bytes = 0;
29 olen += 2;
30 }
31}
32state->bytes = st.bytes;
33state->carry = st.carry;
34*outlen = olen;
35