get rid of strncpy()
apparently when i wrote this code many years ago, i believed into
the "strncpy is the safe strcpy" myth, as so many developers still
do to this day. but in fact it's not, and it zeroes the entire
rest of the buffer when there's enough space, making it inefficient,
while when there isn't enough space, it doesn't even zero-terminate.
anyway, the reason i replace it is also that this is the only usage
of strncpy, so that pulls in an additional function from libc into
our static linked apps, while memcpy is heavily used everywhere
already. the output buffer passed to this function is 768 bytes,
so there's no need to check at all, since we're writing at most
255 bytes for the hostname plus another 9 bytes for the socks4a
header. thus we remove the bufsize argument altogether from the
function.