summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-04-19 23:12:18 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-04-20 19:53:53 +0000
commit27e6ca2de6da17a5bf31160fd2bf3a6f71c67bd6 (patch)
tree847cbec8d121a6936a201f78dec09063ca892e7c
parent06c896bb0249a54c986239dbc45815c21fdb1da1 (diff)
downloadperl-27e6ca2de6da17a5bf31160fd2bf3a6f71c67bd6.tar.gz
Re: [perl #22000] AutoReply: [PATCH] Naughty sv_gets/RsRECORD bug
Message-ID: <20030419171218.GA974@ratsnest.hole> p4raw-id: //depot/perl@19281
-rw-r--r--sv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 5280c08f44..45638099d4 100644
--- a/sv.c
+++ b/sv.c
@@ -6379,6 +6379,8 @@ Perl_sv_gets(pTHX_ register SV *sv, register PerlIO *fp, I32 append)
#else
bytesread = PerlIO_read(fp, buffer, recsize);
#endif
+ if (bytesread < 0)
+ bytesread = 0;
SvCUR_set(sv, bytesread += append);
buffer[bytesread] = '\0';
goto return_string_or_null;