cbc796fb90
Prevent some theorical buffer overruns reported by Coverity. Cleanup a use of gethostname() while here. CID: 1006713, 1011166, 1011167, 1011168,