Project

General

Profile

Bug #10019 » pack.c.patch

wkwood (Will Wood), 07/28/2014 02:47 PM

View differences:

pack.c (working copy)
static void
encodes(VALUE str, const char *s, long len, int type, int tail_lf)
{
enum {buff_size = 4096, encoded_unit = 4};
char buff[buff_size + 1]; /* +1 for tail_lf */
enum {buff_size = 256, encoded_unit = 4};
char buff[buff_size];
long i = 0;
const char *trans = type == 'u' ? uu_table : b64_table;
char padding;
......
s += 3;
len -= 3;
}
if (buff_size-i < encoded_unit) {
if ( ( buff_size-i < encoded_unit ) || len < 3 ) {
rb_str_buf_cat(str, buff, i);
i = 0;
}
(3-3/3)