Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- static int ORYGINAL_encode( char *input, char **output, int linesize )
- {
- char in[3];
- char out[4];
- int i, len, blocksout = 0;
- int retcode = 0;
- *in = 0;
- *out = 0;
- while (*input)
- {
- len = 0;
- for ( i = 0; i < 3; i++ )
- {
- in[i] = *(input++);
- if (*input)
- {
- len++;
- }
- else
- {
- in[i] = 0;
- }
- }
- if ( len > 0 )
- {
- encodeblock( in, out, len );
- strcat(*output, out);
- blocksout++;
- }
- if ( blocksout >= (linesize / 4) || !input )
- {
- if ( blocksout > 0 )
- {
- strcat(*output, "\r\n" );
- }
- blocksout = 0;
- }
- }
- return ( retcode );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement