Make Perl_gv_fetchpvn_flags actually heed the passed in length.
[perl.git] / doio.c
diff --git a/doio.c b/doio.c
index 019312b..c9d0578 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -336,7 +336,7 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
                        }
                        else {
                            GV *thatgv;
-                           thatgv = gv_fetchpvn_flags(type, type-tend,
+                           thatgv = gv_fetchpvn_flags(type, tend - type,
                                                       0, SVt_PVIO);
                            thatio = GvIO(thatgv);
                        }