int error;
/* Get host address. Any type of address will do. */
- bzero(&hints, sizeof(hints));
+ memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_ALL|AI_ADDRCONFIG;
hints.ai_socktype = SOCK_STREAM;
(void) fprintf(stderr,
"getaddrinfo: %s for host %s service %s\n",
gai_strerror(error), hostname, servicename);
- return (-1);
+ return -1;
}
/* Try all returned addresses until one works */
for (aip = res; aip != NULL; aip = aip->ai_next) {
if (sock == -1) {
perror("socket");
freeaddrinfo(res);
- return (-1);
+ return -1;
}
/* Connect to the host. */