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:
parent
a9fb907e0b
commit
d21f31a1a7
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user