1/*********************************************************************\
2
3MODULE NAME: b64.c
4
5AUTHOR: Bob Trower 08/04/01
6
7PROJECT: Crypt Data Packaging
8
--- 232 unchanged lines hidden (view full) ---
241 unsigned i;
242 uint8_t wordout[4];
243 uint8_t wordin[3];
244 char *out = vp;
245 char *outp;
246 int blocksout;
247 int wordlen;
248
249 if (in == NULL || vp == NULL) {
250 return 0;
251 }
252 wordlen = 0;
253 for (blocksout = 0, inp = in, outp = out; (size_t)(inp - in) < insize && (size_t)(outp - out) < outsize;) {
254 for (wordlen = 0, i = 0; i < sizeof(wordin); i++) {
255 wordin[i] = (uint8_t) *inp++;
256 if ((size_t)(inp - in) <= insize) {
257 wordlen++;
258 } else {
259 wordin[i] = 0x0;
--- 45 unchanged lines hidden (view full) ---
305 unsigned wordlen;
306 unsigned i;
307 uint8_t wordout[3];
308 uint8_t wordin[4];
309 uint8_t v;
310 char *out = vp;
311 char *outp;
312
313 if (in == NULL || vp == NULL) {
314 return 0;
315 }
316 for (inp = in, outp = out ; (size_t)(inp - in) < insize && (size_t)(outp - out) < outsize ; ) {
317 for (wordlen = 0, i = 0 ; i < sizeof(wordin) && (size_t)(inp - in) < insize ; i++) {
318 /* get a single character */
319 for (v = 0; (size_t)(inp - in) <= insize && v == 0 ; ) {
320 if (*inp == '\r' && *(inp + 1) == '\n') {
321 inp += 2;
322 } else {
323 v = (uint8_t) *inp++;
--- 32 unchanged lines hidden ---
2
3MODULE NAME: b64.c
4
5AUTHOR: Bob Trower 08/04/01
6
7PROJECT: Crypt Data Packaging
8
--- 232 unchanged lines hidden (view full) ---
241 unsigned i;
242 uint8_t wordout[4];
243 uint8_t wordin[3];
244 char *out = vp;
245 char *outp;
246 int blocksout;
247 int wordlen;
248
249 if (in == NULL || vp == NULL) {
250 return 0;
251 }
252 wordlen = 0;
253 for (blocksout = 0, inp = in, outp = out; (size_t)(inp - in) < insize && (size_t)(outp - out) < outsize;) {
254 for (wordlen = 0, i = 0; i < sizeof(wordin); i++) {
255 wordin[i] = (uint8_t) *inp++;
256 if ((size_t)(inp - in) <= insize) {
257 wordlen++;
258 } else {
259 wordin[i] = 0x0;
--- 45 unchanged lines hidden (view full) ---
305 unsigned wordlen;
306 unsigned i;
307 uint8_t wordout[3];
308 uint8_t wordin[4];
309 uint8_t v;
310 char *out = vp;
311 char *outp;
312
313 if (in == NULL || vp == NULL) {
314 return 0;
315 }
316 for (inp = in, outp = out ; (size_t)(inp - in) < insize && (size_t)(outp - out) < outsize ; ) {
317 for (wordlen = 0, i = 0 ; i < sizeof(wordin) && (size_t)(inp - in) < insize ; i++) {
318 /* get a single character */
319 for (v = 0; (size_t)(inp - in) <= insize && v == 0 ; ) {
320 if (*inp == '\r' && *(inp + 1) == '\n') {
321 inp += 2;
322 } else {
323 v = (uint8_t) *inp++;
--- 32 unchanged lines hidden ---