From 1a52d876f7e10d07f58deee6faeaf70a11a6110f Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Mon, 25 Jun 2018 16:51:47 +0300 Subject: Introduced nxt_length() macro. --- src/nxt_application.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nxt_application.c') 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 -- cgit