diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/curl_addrinfo.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index b8032f4df..f28361062 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -488,7 +488,7 @@ Curl_addrinfo *Curl_str2addr(char *address, int port) Curl_addrinfo *Curl_unix2addr(const char *path) { Curl_addrinfo *ai; - struct sockaddr_un *sun; + struct sockaddr_un *sa_un; size_t path_len; ai = calloc(1, sizeof(Curl_addrinfo)); @@ -500,7 +500,7 @@ Curl_addrinfo *Curl_unix2addr(const char *path) } /* sun_path must be able to store the NUL-terminated path */ path_len = strlen(path); - if(path_len >= sizeof(sun->sun_path)) { + if(path_len >= sizeof(sa_un->sun_path)) { free(ai->ai_addr); free(ai); return NULL; @@ -509,9 +509,9 @@ Curl_addrinfo *Curl_unix2addr(const char *path) ai->ai_family = AF_UNIX; ai->ai_socktype = SOCK_STREAM; /* assume reliable transport for HTTP */ ai->ai_addrlen = (curl_socklen_t) sizeof(struct sockaddr_un); - sun = (void *) ai->ai_addr; - sun->sun_family = AF_UNIX; - memcpy(sun->sun_path, path, path_len + 1); /* copy NUL byte */ + sa_un = (void *) ai->ai_addr; + sa_un->sun_family = AF_UNIX; + memcpy(sa_un->sun_path, path, path_len + 1); /* copy NUL byte */ return ai; } #endif |