Make use of strerror(errno) and format all errors equally: function ['parameters']: error message
Replace warn() and warnx() with fprintf() and add <stdio.h> where necessary.
For multiple reasons the program is now split: - Make future porting to OpenBSD easier - Assign header includes to individiual functions - Make future program extensions easier - Recompile only changed parts