diff options
author | Karl Williamson <khw@cpan.org> | 2017-03-25 14:51:19 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-11-06 14:31:45 -0700 |
commit | 9a73c0b88245534a208321879e36c862e63ee58a (patch) | |
tree | 527274ae29902e4602188751fa435bfbaa3296af /doio.c | |
parent | 5716a028c7461672700c451fd2f25daa794a88bd (diff) | |
download | perl-9a73c0b88245534a208321879e36c862e63ee58a.tar.gz |
doio.c: Change strchr to memchr
This allows things to work properly in the face of embedded NULs.
See the branch merge message for more information.
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -261,7 +261,7 @@ Perl_do_open6(pTHX_ GV *gv, const char *oname, STRLEN len, STRLEN nlen = 0; /* New style explicit name, type is just mode and layer info */ #ifdef USE_STDIO - if (SvROK(*svp) && !strchr(oname,'&')) { + if (SvROK(*svp) && !memchr(oname, '&', len)) { if (ckWARN(WARN_IO)) Perl_warner(aTHX_ packWARN(WARN_IO), "Can't open a reference"); @@ -1630,7 +1630,7 @@ Perl_mode_from_discipline(pTHX_ const char *s, STRLEN len) else { const char *end; fail_discipline: - end = strchr(s+1, ':'); + end = (char *) memchr(s+1, ':', len); if (!end) end = s+len; #ifndef PERLIO_LAYERS |