summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed/process.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-24 11:24:02 +0000
committertjr <tjr@FreeBSD.org>2002-06-24 11:24:02 +0000
commit32bee004db6c06107a4986c715ce26531ef49d8d (patch)
tree0caca06bc2d7c3edb59c2f93741bac34245d2363 /usr.bin/sed/process.c
parentfd860e7d161e33a13065426b1e71ab8af801530c (diff)
downloadFreeBSD-src-32bee004db6c06107a4986c715ce26531ef49d8d.zip
FreeBSD-src-32bee004db6c06107a4986c715ce26531ef49d8d.tar.gz
Fix off by one in `y' (transliterate) command which caused the last character
of the pattern space not to be examined. Noticed by: Motoyuki Konno <motoyuki@bsdclub.org>
Diffstat (limited to 'usr.bin/sed/process.c')
-rw-r--r--usr.bin/sed/process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index 17f543d..83031b1 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -244,7 +244,7 @@ redirect:
case 'y':
if (pd || psl == 0)
break;
- for (p = ps, len = psl; --len; ++p)
+ for (p = ps, len = psl; len--; ++p)
*p = cp->u.y[(unsigned char)*p];
break;
case ':':
OpenPOWER on IntegriCloud