Fix two instances of undefined behaviour in contrib/nvi.

Found by:	clang ToT
Obtained from:	NetBSD
Reviewed by:	jh
MFC after:	3 days
This commit is contained in:
Dimitry Andric 2013-02-16 12:48:06 +00:00
parent a9fb907e0b
commit d21f31a1a7
2 changed files with 6 additions and 4 deletions

View File

@ -398,8 +398,8 @@ txt_dent(sp, tp)
++scno;
/* Get the previous shiftwidth column. */
cno = scno;
scno -= --scno % sw;
cno = scno--;
scno -= scno % sw;
/*
* Since we don't know what comes before the character(s) being

View File

@ -1956,8 +1956,10 @@ txt_dent(sp, tp, isindent)
target = current;
if (isindent)
target += COL_OFF(target, sw);
else
target -= --target % sw;
else {
--target;
target -= target % sw;
}
/*
* The AI characters will be turned into overwrite characters if the