Handle server name overflow properly

We need to make sure it is null terminated on truncation. We also
need to avoid giving a too large size argument or modern gcc will
complain.
1 file changed