summaryrefslogtreecommitdiff
path: root/mg.c
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
commitbaf98d40d2b781afd2a2c009a75ef1c9b5e0bb23 (patch)
treef29225f2adaaf97f9030507b31ef595023a9795b /mg.c
parentafce8e557544caa220786ceec07d27d654f3b416 (diff)
downloadperl-baf98d40d2b781afd2a2c009a75ef1c9b5e0bb23.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
Diffstat (limited to 'mg.c')
-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. */