IoTYPE(io) = PerlIO_intmode2str(rawmode, &mode[ix], &writing);
- namesv = sv_2mortal(newSVpvn(oname,strlen(oname)));
+ namesv = sv_2mortal(newSVpv(oname,0));
num_svs = 1;
svp = &namesv;
type = Nullch;
for (s = SvPVX(sv); *s; s++) {
if (*s == ':' && s[1] == ':') {
+ const STRLEN len = strlen(s+2)+1;
*s = '/';
- Move(s+2, s+1, strlen(s+2)+1, char);
+ Move(s+2, s+1, len, char);
SvCUR_set(sv, SvCUR(sv) - 1);
}
}
if (PL_statbuf.st_mode & (S_ISUID|S_ISGID)) {
I32 len;
const char *linestr;
+ const char *s_end;
#ifdef IAMSUID
if (PL_fdscript < 0 || PL_suidscript != 1)
s = linestr;
/* PSz 27 Feb 04 */
/* Sanity check on line length */
- if (strlen(s) < 1 || strlen(s) > 4000)
+ s_end = s + strlen(s);
+ if (s_end == s || (s_end - s) > 4000)
Perl_croak(aTHX_ "Very long #! line");
/* Allow more than a single space after #! */
while (isSPACE(*s)) s++;
len = strlen(validarg);
if (strEQ(validarg," PHOOEY ") ||
strnNE(s,validarg,len) || !isSPACE(s[len]) ||
- !(strlen(s) == len+1 || (strlen(s) == len+2 && isSPACE(s[len+1]))))
+ !((s_end - s) == len+1
+ || ((s_end - s) == len+2 && isSPACE(s[len+1]))))
Perl_croak(aTHX_ "Args must match #! line");
#ifndef IAMSUID
/* 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;
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);
}
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);
}
{
q++; /* skip past the rest of the %vd format */
eptr = (const char *) vecstr;
- elen = strlen(eptr);
+ elen = veclen;
vectorize=FALSE;
goto string;
}
if (t - s > 0) {
#ifndef USE_ITHREADS
const char * const cf = CopFILE(PL_curcop);
- if (cf && strlen(cf) > 7 && strnEQ(cf, "(eval ", 6)) {
+ STRLEN tmplen = cf ? strlen(cf) : 0;
+ if (tmplen > 7 && strnEQ(cf, "(eval ", 6)) {
/* must copy *{"::_<(eval N)[oldfilename:L]"}
* to *{"::_<newfilename"} */
char smallbuf[256], smallbuf2[256];
* size from the heap if they are given a NULL buffer pointer.
* The problem is that this behaviour is not portable. */
if (getcwd(buf, sizeof(buf) - 1)) {
- sv_setpvn(sv, buf, strlen(buf));
+ sv_setpv(sv, buf);
return TRUE;
}
else {