summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_sockaddr.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2017-06-27 17:27:18 +0300
committerValentin Bartenev <vbart@nginx.com>2017-06-27 17:27:18 +0300
commitdfd3cc8c0eb7f3479ee08b5e518abd264da56a29 (patch)
treeb6cdbfab23ce9ea2c498bcb0f540d4847472f067 /src/nxt_sockaddr.c
parentf86c80309885230df2960ef8e1db337f04b11926 (diff)
downloadunit-dfd3cc8c0eb7f3479ee08b5e518abd264da56a29.tar.gz
unit-dfd3cc8c0eb7f3479ee08b5e518abd264da56a29.tar.bz2
Applied nxt_pointer_to() and nxt_value_at() where possible.
Diffstat (limited to '')
-rw-r--r--src/nxt_sockaddr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nxt_sockaddr.c b/src/nxt_sockaddr.c
index 6db15d13..3ec4abb6 100644
--- a/src/nxt_sockaddr.c
+++ b/src/nxt_sockaddr.c
@@ -189,7 +189,7 @@ nxt_sockaddr_text(nxt_sockaddr_t *sa)
u_char *p, *start, *end, *octet;
uint32_t port;
- end = (u_char *) sa + sa->sockaddr_size;
+ end = nxt_pointer_to(sa, sa->sockaddr_size);
switch (sa->u.sockaddr.sa_family) {
@@ -199,7 +199,7 @@ nxt_sockaddr_text(nxt_sockaddr_t *sa)
sa->start = offset;
sa->address_start = offset;
- start = (u_char *) sa + offset;
+ start = nxt_pointer_to(sa, offset);
octet = (u_char *) &sa->u.sockaddr_in.sin_addr;
p = nxt_sprintf(start, end, "%ud.%ud.%ud.%ud",
@@ -220,7 +220,7 @@ nxt_sockaddr_text(nxt_sockaddr_t *sa)
sa->start = offset;
sa->address_start = offset;
- start = (u_char *) sa + offset;
+ start = nxt_pointer_to(sa, offset);
p = start;
*p++ = '[';
@@ -247,7 +247,7 @@ nxt_sockaddr_text(nxt_sockaddr_t *sa)
sa->start = offset;
sa->address_start = offset;
- start = (u_char *) sa + offset;
+ start = nxt_pointer_to(sa, offset);
p = start;
#if (NXT_LINUX)