summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-11-17 22:54:17 +0000
committerNicholas Clark <nick@ccl4.org>2008-11-17 22:54:17 +0000
commit1d963ff3e27fd02ffafca14b9a60d1e71f32caa7 (patch)
tree513178eec5ae0fa885444f4dd122a60dabadbf38 /pp_ctl.c
parente389bba906c384f4fc3f3ad5e721e737cbd5d54e (diff)
downloadperl-1d963ff3e27fd02ffafca14b9a60d1e71f32caa7.tar.gz
S_save_lines() was using strchr() when it should have been using
memchr(). Result - eval""ed source with embedded NULs was not split correctly into lines for the debugger. Obscure. But still a bug. Maybe the Campaign for the Elimination of strlen() needs to take a long hard stare at every strchr() too. And strmp() while we're looking. p4raw-id: //depot/perl@34876
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index cd5c1c1c86..ba0dee08fe 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2764,7 +2764,7 @@ S_save_lines(pTHX_ AV *array, SV *sv)
const char *t;
SV * const tmpstr = newSV_type(SVt_PVMG);
- t = strchr(s, '\n');
+ t = (const char *)memchr(s, '\n', send - s);
if (t)
t++;
else