Use the correct length when copying trailing data!!

PR:		77104
Submitted by:	Martin Birgmeier martin at email dot aon dot at
MFC after:	3 days
This commit is contained in:
Brian Somers 2005-02-08 10:38:24 +00:00
parent b9f5e42283
commit 23417e56ea
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141504

View File

@ -455,7 +455,7 @@ subst(char *tgt, const char *oldstr, const char *newstr)
tgt = ntgt;
}
if (lnewstr > loldstr)
bcopy(word + loldstr, word + lnewstr, ltgt - pos - loldstr);
bcopy(word + loldstr, word + lnewstr, ltgt - pos - lnewstr);
bcopy(newstr, word, lnewstr);
} while ((word = strstrword(word, oldstr)));