diff options
author | Benjamin Sugars <bsugars@canoe.ca> | 2001-05-09 08:42:30 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-09 16:25:42 +0000 |
commit | fb70fc7c36e397e79cee05db45026e1462029dd9 (patch) | |
tree | 72b2ebdaee25a4d08fd4962289a002350f279146 /perlio.c | |
parent | 75effbe0883c73e5d0f7c9626142eb85d956f1d3 (diff) | |
download | perl-fb70fc7c36e397e79cee05db45026e1462029dd9.tar.gz |
Re: [PATCH] Test offset when reading from a PerlIO::Scalar
Message-ID: <Pine.LNX.4.21.0105091230110.1516-100000@marmot.rim.canoe.ca>
p4raw-id: //depot/perl@10054
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1646,7 +1646,9 @@ PerlIOBase_read(PerlIO *f, void *vbuf, Size_t count) while (count > 0) { SSize_t avail = PerlIO_get_cnt(f); - SSize_t take = (count < avail) ? count : avail; + SSize_t take = 0; + if (avail > 0) + take = (count < avail) ? count : avail; if (take > 0) { STDCHAR *ptr = PerlIO_get_ptr(f); |