make sure provided hostname is null-terminated