summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index 655a8addd9..e277d76a78 100644
--- a/sv.c
+++ b/sv.c
@@ -8066,13 +8066,13 @@ Perl_sv_gets(pTHX_ SV *const sv, PerlIO *const fp, I32 append)
if (!PerlLIO_fstat(PerlIO_fileno(fp), &st) && S_ISREG(st.st_mode)) {
const Off_t offset = PerlIO_tell(fp);
if (offset != (Off_t) -1 && st.st_size + append > offset) {
- (void) SvGROW(sv, (STRLEN)((st.st_size - offset) + append + 1
#ifdef PERL_NEW_COPY_ON_WRITE
- /* Add an extra byte for the sake of copy-on-
- write's buffer reference count. */
- + 1
+ /* Add an extra byte for the sake of copy-on-write's
+ * buffer reference count. */
+ (void) SvGROW(sv, (STRLEN)((st.st_size - offset) + append + 2));
+#else
+ (void) SvGROW(sv, (STRLEN)((st.st_size - offset) + append + 1));
#endif
- ));
}
}
rsptr = NULL;