s = SvPVX(sv);
if (newlen > SvLEN(sv)) { /* need more room? */
if (SvLEN(sv) && s) {
-#if defined(MYMALLOC) && !defined(PURIFY)
+#if defined(MYMALLOC) && !defined(PURIFY) && !defined(LEAKTEST)
STRLEN l = malloced_size((void*)SvPVX(sv));
if (newlen <= l) {
SvLEN_set(sv, l);
{
dTHR;
croak("Can't coerce %s to integer in %s", sv_reftype(sv,0),
- op_desc[op->op_type]);
+ op_desc[PL_op->op_type]);
}
}
(void)SvIOK_only(sv); /* validate number */
{
dTHR;
croak("Can't coerce %s to number in %s", sv_reftype(sv,0),
- op_name[op->op_type]);
+ op_name[PL_op->op_type]);
}
}
SvNVX(sv) = num;
}
*d = '\0';
- if (op)
+ if (PL_op)
warn("Argument \"%s\" isn't numeric in %s", tmpbuf,
- op_name[op->op_type]);
+ op_name[PL_op->op_type]);
else
warn("Argument \"%s\" isn't numeric", tmpbuf);
}
case SVt_PVHV:
case SVt_PVCV:
case SVt_PVIO:
- if (op)
+ if (PL_op)
croak("Bizarre copy of %s in %s", sv_reftype(sstr, 0),
- op_name[op->op_type]);
+ op_name[PL_op->op_type]);
else
croak("Bizarre copy of %s", sv_reftype(sstr, 0));
break;
/* Grab the size of the record we're getting */
recsize = SvIV(SvRV(PL_rs));
(void)SvPOK_only(sv); /* Validate pointer */
- /* Make sure we've got the room to yank in the whole thing */
- if (SvLEN(sv) <= recsize + 3) {
- /* No, so make it bigger */
- SvGROW(sv, recsize + 3);
- }
- buffer = SvPVX(sv); /* Get the location of the final buffer */
+ buffer = SvGROW(sv, recsize + 1);
/* Go yank in */
#ifdef VMS
/* VMS wants read instead of fread, because fread doesn't respect */
bytesread = PerlIO_read(fp, buffer, recsize);
#endif
SvCUR_set(sv, bytesread);
+ buffer[bytesread] = '\0';
return(SvCUR(sv) ? SvPVX(sv) : Nullch);
}
else if (RsPARA(PL_rs)) {
else {
dTHR;
croak("Can't coerce %s to string in %s", sv_reftype(sv,0),
- op_name[op->op_type]);
+ op_name[PL_op->op_type]);
}
}
else
default:
unknown:
if (!args && PL_dowarn &&
- (op->op_type == OP_PRTF || op->op_type == OP_SPRINTF)) {
+ (PL_op->op_type == OP_PRTF || PL_op->op_type == OP_SPRINTF)) {
SV *msg = sv_newmortal();
sv_setpvf(msg, "Invalid conversion in %s: ",
- (op->op_type == OP_PRTF) ? "printf" : "sprintf");
+ (PL_op->op_type == OP_PRTF) ? "printf" : "sprintf");
if (c)
sv_catpvf(msg, isPRINT(c) ? "\"%%%c\"" : "\"%%\\%03o\"",
c & 0xFF);