diff options
author | dim <dim@FreeBSD.org> | 2013-02-16 12:48:06 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-02-16 12:48:06 +0000 |
commit | b08c7605748ff7a8d801b82f0eb6f6664b6d38ca (patch) | |
tree | 21f86eba20b9d0d899cbf595a5e23ee498a2cfd4 /contrib/nvi/vi | |
parent | 581bacc0c7e225816fb6977d49c3784ff0cfc0e9 (diff) | |
download | FreeBSD-src-b08c7605748ff7a8d801b82f0eb6f6664b6d38ca.zip FreeBSD-src-b08c7605748ff7a8d801b82f0eb6f6664b6d38ca.tar.gz |
Fix two instances of undefined behaviour in contrib/nvi.
Found by: clang ToT
Obtained from: NetBSD
Reviewed by: jh
MFC after: 3 days
Diffstat (limited to 'contrib/nvi/vi')
-rw-r--r-- | contrib/nvi/vi/v_txt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/nvi/vi/v_txt.c b/contrib/nvi/vi/v_txt.c index 4a3e80a..0cb1ff5 100644 --- a/contrib/nvi/vi/v_txt.c +++ b/contrib/nvi/vi/v_txt.c @@ -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 |