util.c snprintf() bug fix

Old merged code had several issues with passing the incorrect size.
util.c tidy up - rewrites old merged code