maintain a common vprint_errormsg function for printing error messages
maintain a common vprint_errormsg function for printing error messages

(v)snprintf may return -1 on errors. Hence using its return value to
alter the position of the error message buffer needs to undergo some
checking first.

bvdberg/ctest