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;
|
++scno;
|
||||||
|
|
||||||
/* Get the previous shiftwidth column. */
|
/* Get the previous shiftwidth column. */
|
||||||
cno = scno;
|
cno = scno--;
|
||||||
scno -= --scno % sw;
|
scno -= scno % sw;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since we don't know what comes before the character(s) being
|
* Since we don't know what comes before the character(s) being
|
||||||
|
@ -1956,8 +1956,10 @@ txt_dent(sp, tp, isindent)
|
|||||||
target = current;
|
target = current;
|
||||||
if (isindent)
|
if (isindent)
|
||||||
target += COL_OFF(target, sw);
|
target += COL_OFF(target, sw);
|
||||||
else
|
else {
|
||||||
target -= --target % sw;
|
--target;
|
||||||
|
target -= target % sw;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The AI characters will be turned into overwrite characters if the
|
* The AI characters will be turned into overwrite characters if the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user