diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-11-08 21:37:52 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-11-08 21:37:52 +0000 |
commit | 42d9b98d3f03094883cfc4bb765785a6d4396077 (patch) | |
tree | cb639739736f31b4c4068d5e3c9eb09b306d89fd /perlio.c | |
parent | f7997f866fdcafc687fbaa99dbeb48f109b2e8d8 (diff) | |
download | perl-42d9b98d3f03094883cfc4bb765785a6d4396077.tar.gz |
Eliminate some unnecessary strlen()s
p4raw-id: //depot/perl@26050
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -475,8 +475,8 @@ PerlIO_debug(const char *fmt, ...) /* Use fixed buffer as sv_catpvf etc. needs SVs */ char buffer[1024]; const STRLEN len = my_sprintf(buffer, "%.40s:%" IVdf " ", s ? s : "(none)", (IV) CopLINE(PL_curcop)); - vsprintf(buffer+len, fmt, ap); - PerlLIO_write(PL_perlio_debug_fd, buffer, strlen(buffer)); + const STRLEN len2 = vsprintf(buffer+len, fmt, ap); + PerlLIO_write(PL_perlio_debug_fd, buffer, len + len2); #else const char *s = CopFILE(PL_curcop); STRLEN len; @@ -4785,7 +4785,7 @@ PerlIO * PerlIO_open(const char *path, const char *mode) { dTHX; - SV *name = sv_2mortal(newSVpvn(path, strlen(path))); + SV *name = sv_2mortal(newSVpv(path, 0)); return PerlIO_openn(aTHX_ Nullch, mode, -1, 0, 0, NULL, 1, &name); } @@ -4794,7 +4794,7 @@ PerlIO * PerlIO_reopen(const char *path, const char *mode, PerlIO *f) { dTHX; - SV *name = sv_2mortal(newSVpvn(path, strlen(path))); + SV *name = sv_2mortal(newSVpv(path,0)); return PerlIO_openn(aTHX_ Nullch, mode, -1, 0, 0, f, 1, &name); } |