--- Zlib.xs Sat Apr 28 14:18:55 2001 +++ /home/tobez/Zlib.xs Fri Aug 24 15:24:34 2001 @@ -639,7 +639,7 @@ croak("cannot use buf argument as lvalue"); SvPOK_only(buf); /* sv_setpvn(buf, "", SIZE) ; */ - SvGROW(buf, SIZE) ; + SvGROW(buf, SIZE + 1) ; SvCUR_set(buf, 0); RETVAL = gzreadline(file, buf) ; SetGzError(file->gz) ; @@ -852,7 +852,7 @@ while (s->stream.avail_in != 0) { if (s->stream.avail_out == 0) { - SvGROW(output, outsize + s->bufsize) ; + SvGROW(output, outsize + s->bufsize + 1) ; s->stream.next_out = (Bytef*) SvPVX(output) + outsize ; outsize += s->bufsize ; s->stream.avail_out = s->bufsize ; @@ -905,7 +905,7 @@ for (;;) { if (s->stream.avail_out == 0) { /* consumed all the available output, so extend it */ - SvGROW(output, outsize + s->bufsize) ; + SvGROW(output, outsize + s->bufsize + 1) ; s->stream.next_out = (Bytef*)SvPVX(output) + outsize ; outsize += s->bufsize ; s->stream.avail_out = s->bufsize ; @@ -981,7 +981,7 @@ while (1) { if (s->stream.avail_out == 0) { - SvGROW(output, outsize + s->bufsize) ; + SvGROW(output, outsize + s->bufsize + 1) ; s->stream.next_out = (Bytef*) SvPVX(output) + outsize ; outsize += s->bufsize ; s->stream.avail_out = s->bufsize ;