This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
S_save_hek_flags should honour the "free" flag.
[perl5.git] / regcomp.c
index ded3c63..6293ade 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5045,7 +5045,7 @@ S_re_croak2(pTHX_ const char* pat1,const char* pat2,...)
     if (l1 > 512)
        l1 = 512;
     Copy(message, buf, l1 , char);
-    buf[l1] = '\0';                    /* Overwrite \n */
+    buf[l1-1] = '\0';                  /* Overwrite \n */
     Perl_croak(aTHX_ "%s", buf);
 }