summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_sockaddr.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-06-25 16:51:47 +0300
committerValentin Bartenev <vbart@nginx.com>2018-06-25 16:51:47 +0300
commit1a52d876f7e10d07f58deee6faeaf70a11a6110f (patch)
treef69ba903180b3deac3bba2ee7acda9d34f18d73c /src/nxt_sockaddr.c
parentaf31012815e20f0c92ed6ea803638a16ba47b0c2 (diff)
downloadunit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.gz
unit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.bz2
Introduced nxt_length() macro.
Diffstat (limited to 'src/nxt_sockaddr.c')
-rw-r--r--src/nxt_sockaddr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_sockaddr.c b/src/nxt_sockaddr.c
index 0df40a1f..9bf32a11 100644
--- a/src/nxt_sockaddr.c
+++ b/src/nxt_sockaddr.c
@@ -203,7 +203,7 @@ nxt_getsockname(nxt_task_t *task, nxt_mp_t *mp, nxt_socket_t s)
#if (NXT_HAVE_UNIX_DOMAIN)
case AF_UNIX:
- length = sizeof("unix:") - 1 + socklen;
+ length = nxt_length("unix:") + socklen;
#endif
break;
@@ -515,7 +515,7 @@ nxt_inet6_ntop(u_char *addr, u_char *buf, u_char *end)
nxt_uint_t i, zero_start, last_zero_start;
const size_t max_inet6_length =
- sizeof("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") - 1;
+ nxt_length("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff");
if (buf + max_inet6_length > end) {
return buf;