Improve data validation:
authorChris Pressey <cpressey@dragonflybsd.org>
Wed, 2 Mar 2005 07:20:44 +0000 (07:20 +0000)
committerChris Pressey <cpressey@dragonflybsd.org>
Wed, 2 Mar 2005 07:20:44 +0000 (07:20 +0000)
commit82996da1a799b354f45e474cd91adc5353571aff
treea234c009d5d58fd0905a51839523de42a103967e
parent0a71d42f8b7dc910ea74e0f7a0fdbdd338623599
Improve data validation:
- Simplify the check for a well-formed -a argument.
- Move the check for overflowing the command table from addcmd()
  (which is just a driver) into addmac() (which does the real work,
  and which is called from places besides addcmd().)
- Add a check for overflowing the macro-pair table.
- In each case, use a clearer (while) loop for detecting overflow.
- In each case, error out by using errx().
usr.bin/checknr/checknr.c