summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 8a6c17a59a..e40665644d 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -808,6 +808,8 @@ PP(pp_leavewrite)
if (IoFLAGS(io) & IOf_DIDTOP) { /* Oh dear. It still doesn't fit. */
I32 lines = IoLINES_LEFT(io);
char *s = SvPVX(formtarget);
+ if (lines <= 0) /* Yow, header didn't even fit!!! */
+ goto forget_top;
while (lines-- > 0) {
s = strchr(s, '\n');
if (!s)
@@ -1455,9 +1457,9 @@ nuts:
PP(pp_accept)
{
- struct sockaddr_in saddr; /* use a struct to avoid alignment problems */
dSP; dTARGET;
#ifdef HAS_SOCKET
+ struct sockaddr_in saddr; /* use a struct to avoid alignment problems */
GV *ngv;
GV *ggv;
register IO *nstio;