summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhijit Menon-Sen <ams@wiw.org>2003-10-26 08:08:02 +0000
committerAbhijit Menon-Sen <ams@wiw.org>2003-10-26 08:08:02 +0000
commit571718741434f712bd7c0d0594df3cbe85012f40 (patch)
treef29225f2adaaf97f9030507b31ef595023a9795b
parent5a011502e376c1626e94972164696c976ea0d567 (diff)
downloadperl-571718741434f712bd7c0d0594df3cbe85012f40.tar.gz
Fix off-by-one in $0 set magic. (From Autrijus.)
The whole PL_origalen thing in perl.c looks very hokey. p4raw-id: //depot/perl@21538
-rw-r--r--mg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index bcb0188f8b..95fc54dd22 100644
--- a/mg.c
+++ b/mg.c
@@ -2403,7 +2403,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
if (len >= (STRLEN)PL_origalen) {
/* Longer than original, will be truncated. */
Copy(s, PL_origargv[0], PL_origalen, char);
- PL_origargv[0][PL_origalen - 1] = 0;
+ PL_origargv[0][PL_origalen] = 0;
}
else {
/* Shorter than original, will be padded. */