summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-11-20 20:39:50 +0000
committerNicholas Clark <nick@ccl4.org>2005-11-20 20:39:50 +0000
commitfc009855d5dd3ec0391bdd89fe8d709ff3609d46 (patch)
tree6bba20e88b5b7f7ea3461fe32381a2bbe38d9d4d /pp_ctl.c
parentef35129c7fc9e8b23677855fe4f6e7aa37b32ef4 (diff)
downloadperl-fc009855d5dd3ec0391bdd89fe8d709ff3609d46.tar.gz
Eliminate two more strlen()s, by using the return value of sprintf().
p4raw-id: //depot/perl@26180
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index ed64242076..40928caec5 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2746,9 +2746,11 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, const char *code, PAD** padp)
code, (unsigned long)++PL_evalseq,
CopFILE(PL_curcop), (IV)CopLINE(PL_curcop));
tmpbuf = SvPVX(sv);
+ len = SvCUR(sv);
}
else
- sprintf(tmpbuf, "_<(%.10s_eval %lu)", code, (unsigned long)++PL_evalseq);
+ len = my_sprintf(tmpbuf, "_<(%.10s_eval %lu)", code,
+ (unsigned long)++PL_evalseq);
SAVECOPFILE_FREE(&PL_compiling);
CopFILE_set(&PL_compiling, tmpbuf+2);
SAVECOPLINE(&PL_compiling);
@@ -2758,7 +2760,6 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, const char *code, PAD** padp)
(i.e. before run-time proper). To work around the coredump that
ensues, we always turn GvMULTI_on for any globals that were
introduced within evals. See force_ident(). GSAR 96-10-12 */
- len = strlen(tmpbuf);
safestr = savepvn(tmpbuf, len);
SAVEDELETE(PL_defstash, safestr, len);
SAVEHINTS();
@@ -3406,9 +3407,10 @@ PP(pp_entereval)
(unsigned long)++PL_evalseq,
CopFILE(PL_curcop), (IV)CopLINE(PL_curcop));
tmpbuf = SvPVX(sv);
+ len = SvCUR(sv);
}
else
- sprintf(tmpbuf, "_<(eval %lu)", (unsigned long)++PL_evalseq);
+ len = my_sprintf(tmpbuf, "_<(eval %lu)", (unsigned long)++PL_evalseq);
SAVECOPFILE_FREE(&PL_compiling);
CopFILE_set(&PL_compiling, tmpbuf+2);
SAVECOPLINE(&PL_compiling);
@@ -3418,7 +3420,6 @@ PP(pp_entereval)
(i.e. before run-time proper). To work around the coredump that
ensues, we always turn GvMULTI_on for any globals that were
introduced within evals. See force_ident(). GSAR 96-10-12 */
- len = strlen(tmpbuf);
safestr = savepvn(tmpbuf, len);
SAVEDELETE(PL_defstash, safestr, len);
SAVEHINTS();