diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Handle.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc index 3d60fda..199aa4b 100644 --- a/lib/Handle.cc +++ b/lib/Handle.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: Handle.cc,v 1.67 2003-12-27 01:51:41 pixel Exp $ */ +/* $Id: Handle.cc,v 1.68 2003-12-27 13:36:48 pixel Exp $ */ #include <stdio.h> #include <string.h> @@ -509,6 +509,9 @@ void copyone(Handle * s, Handle * d, ssize_t size) { unsigned char c; long r; + if (size < 0) + size = s->GetSize(); + for (i = 0; (i < size) || (size < 0); i++) { r = s->read(&c, 1); if (r == 0) { @@ -525,6 +528,9 @@ void copy(Handle * s, Handle * d, ssize_t size) { static unsigned char b[BSIZE]; long r; + if (size < 0) + size = s->GetSize(); + while (size) { if ((size > BSIZE) || (size < 0)) { r = s->read(b, BSIZE); |