File: enc_tail.c

package info (click to toggle)
python-librt 0.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 920 kB
  • sloc: ansic: 13,889; python: 293; makefile: 6
file content (34 lines) | stat: -rw-r--r-- 637 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
		if (slen-- == 0) {
			break;
		}
		*o++ = base64_table_enc_6bit[*s >> 2];
		st.carry = (*s++ << 4) & 0x30;
		st.bytes++;
		olen += 1;

		// Deliberate fallthrough:
		BASE64_FALLTHROUGH

	case 1:	if (slen-- == 0) {
			break;
		}
		*o++ = base64_table_enc_6bit[st.carry | (*s >> 4)];
		st.carry = (*s++ << 2) & 0x3C;
		st.bytes++;
		olen += 1;

		// Deliberate fallthrough:
		BASE64_FALLTHROUGH

	case 2:	if (slen-- == 0) {
			break;
		}
		*o++ = base64_table_enc_6bit[st.carry | (*s >> 6)];
		*o++ = base64_table_enc_6bit[*s++ & 0x3F];
		st.bytes = 0;
		olen += 2;
	}
}
state->bytes = st.bytes;
state->carry = st.carry;
*outlen = olen;