summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_application.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_application.c
parentaf31012815e20f0c92ed6ea803638a16ba47b0c2 (diff)
downloadunit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.gz
unit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.bz2
Introduced nxt_length() macro.
Diffstat (limited to 'src/nxt_application.c')
-rw-r--r--src/nxt_application.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nxt_application.c b/src/nxt_application.c
index 186614a0..8b5779c3 100644
--- a/src/nxt_application.c
+++ b/src/nxt_application.c
@@ -138,7 +138,7 @@ nxt_discovery_modules(nxt_task_t *task, const char *path)
}
}
- size = sizeof("[]") - 1;
+ size = nxt_length("[]");
module = modules->elts;
n = modules->nelts;
@@ -146,9 +146,9 @@ nxt_discovery_modules(nxt_task_t *task, const char *path)
nxt_debug(task, "module: %d %V %V",
module[i].type, &module[i].version, &module[i].file);
- size += sizeof("{\"type\": ,") - 1;
- size += sizeof(" \"version\": \"\",") - 1;
- size += sizeof(" \"file\": \"\"},") - 1;
+ size += nxt_length("{\"type\": ,");
+ size += nxt_length(" \"version\": \"\",");
+ size += nxt_length(" \"file\": \"\"},");
size += NXT_INT_T_LEN
+ module[i].version.length