When b_slow_realign is called with the <output> parameter equal to 0, the
buffer's head, after the realign, must be set to 0. It was errornously set to
the buffer's size, because there was no test on the value of <output>.
memcpy(b_orig(b), swap, b_data(b) - output);
memcpy(b_wrap(b) - output, swap + b_size(b) - output, output);
- b->head = b_size(b) - output;
+ b->head = (output ? b_size(b) - output : 0);
}
/* b_putchar() : tries to append char <c> at the end of buffer <b>. Supports