Skip to content
Snippets Groups Projects
Commit 182950ea authored by Marek Vavruša's avatar Marek Vavruša
Browse files

sockaddr_hostname: initialized variables to be sure

parent 6e640150
No related branches found
No related tags found
Loading
......@@ -156,13 +156,13 @@ void sockaddr_port_set(struct sockaddr_storage *ss, uint16_t port)
char *sockaddr_hostname(void)
{
/* Fetch hostname. */
char host[KNOT_DNAME_MAXLEN];
char host[KNOT_DNAME_MAXLEN] = {'\0'};
if (gethostname(host, KNOT_DNAME_MAXLEN) != 0) {
return NULL;
}
/* Fetch canonical name for this address/DNS. */
struct addrinfo hints, *info;
struct addrinfo hints, *info = NULL;
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment