$NetBSD: patch-ab,v 1.1 2007/02/20 19:15:03 snj Exp $ --- patch.c.orig 2007-02-20 10:59:09.000000000 -0800 +++ patch.c 2007-02-20 11:00:35.000000000 -0800 @@ -214,12 +214,9 @@ static rs_result rs_patch_s_copying(rs_j void *buf, *ptr; rs_buffers_t *buffs = job->stream; - len = job->basis_len; - /* copy only as much as will fit in the output buffer, so that we * don't have to block or store the input. */ - if (len > buffs->avail_out) - len = buffs->avail_out; + len = (buffs->avail_out < job->basis_len) ? buffs->avail_out : job->basis_len; if (!len) return RS_BLOCKED;