summaryrefslogtreecommitdiff
path: root/devel/librsync/patches/patch-ab
blob: 5764251127b30f2d923b38195c9aacb1bcf37a48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$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;