Audit cols(1)

1) Refactor manpage.
2) De-globalize local values.
3) update usage().
4) sort local variable declarations.
5) fix wrong argument in strtonum (3 -> 1).
6) argc-argv style, boolean style.
7) check bytes > 0 before accessing b.lines[i][bytes - 1]
   relying on len only makes sense but let's not push it.
7) don't break on maxlen > (chars - 1) / 2. This didn't even
   make sense.
8) _correctly_ calculate cols and rows in a readable way.
9) Rewrite loop over rows and cols in a readable way and
   using putchar in a loop instead of printf-magic or fputs
   where not necessary.
This commit is contained in:
FRIGN
2015-03-08 19:33:46 +01:00
parent 78187474cf
commit f140403fca
3 changed files with 43 additions and 52 deletions

2
README
View File

@@ -18,7 +18,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
=*| chroot non-posix none
=* cksum yes none
=* cmp yes none
#* cols non-posix none
#*| cols non-posix none
col yes none
=* comm yes none
=*| cp yes none (-i)