From: Abhijit Menon-Sen Date: Sun, 26 Oct 2003 08:08:02 +0000 (+0000) Subject: Fix off-by-one in $0 set magic. (From Autrijus.) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=baf98d40d2b781afd2a2c009a75ef1c9b5e0bb23;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/mg.c b/mg.c index bcb0188..95fc54d 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. */