From 60ae0314c076971e786e3c56a7514f081f4b16ee Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 11 Apr 2017 15:59:17 +0300 Subject: Fixed building on MacOSX. --- src/nxt_conf_json.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/nxt_conf_json.c b/src/nxt_conf_json.c index 109edf22..5808e5a6 100644 --- a/src/nxt_conf_json.c +++ b/src/nxt_conf_json.c @@ -812,31 +812,27 @@ nxt_conf_json_print(nxt_conf_json_value_t *value, nxt_mem_pool_t *pool) static uintptr_t nxt_conf_json_print_value(u_char *pos, nxt_conf_json_value_t *value) { - static const u_char null[4] = "null"; - static const u_char true[4] = "true"; - static const u_char false[5] = "false"; - switch (value->type) { case NXT_CONF_JSON_NULL: if (pos == NULL) { - return sizeof(null); + return sizeof("null") - 1; } - return (uintptr_t) nxt_cpymem(pos, null, sizeof(null)); + return (uintptr_t) nxt_cpymem(pos, "null", 4); case NXT_CONF_JSON_BOOLEAN: if (pos == NULL) { - return value->u.boolean ? 4 : 5; + return value->u.boolean ? sizeof("true") - 1 : sizeof("false") - 1; } if (value->u.boolean) { - return (uintptr_t) nxt_cpymem(pos, true, sizeof(true)); + return (uintptr_t) nxt_cpymem(pos, "true", 4); } - return (uintptr_t) nxt_cpymem(pos, false, sizeof(false)); + return (uintptr_t) nxt_cpymem(pos, "false", 5); case NXT_CONF_JSON_INTEGER: return nxt_conf_json_print_integer(pos, value); -- cgit