summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conf.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_conf.c
parentaf31012815e20f0c92ed6ea803638a16ba47b0c2 (diff)
downloadunit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.gz
unit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.bz2
Introduced nxt_length() macro.
Diffstat (limited to '')
-rw-r--r--src/nxt_conf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nxt_conf.c b/src/nxt_conf.c
index b3aabcba..34515c1f 100644
--- a/src/nxt_conf.c
+++ b/src/nxt_conf.c
@@ -1878,10 +1878,10 @@ nxt_conf_json_length(nxt_conf_value_t *value, nxt_conf_json_pretty_t *pretty)
switch (value->type) {
case NXT_CONF_VALUE_NULL:
- return sizeof("null") - 1;
+ return nxt_length("null");
case NXT_CONF_VALUE_BOOLEAN:
- return value->u.boolean ? sizeof("true") - 1 : sizeof("false") - 1;
+ return value->u.boolean ? nxt_length("true") : nxt_length("false");
case NXT_CONF_VALUE_INTEGER:
return nxt_conf_json_integer_length(value);
@@ -1952,11 +1952,11 @@ nxt_conf_json_integer_length(nxt_conf_value_t *value)
num = llabs(value->u.integer);
if (num <= 9999) {
- return sizeof("-9999") - 1;
+ return nxt_length("-9999");
}
if (num <= 99999999999LL) {
- return sizeof("-99999999999") - 1;
+ return nxt_length("-99999999999");
}
return NXT_INT64_T_LEN;