summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-11-08 17:38:07 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2023-11-08 17:38:07 +0000
commit78c133d0ca3c343135e123a087970837afdebed1 (patch)
tree4a44c1eeadcd519b2042e0554a8fd894627c4a87 /src
parenta88e857b5b4100bb62be8a73c1badd999561b328 (diff)
downloadunit-78c133d0ca3c343135e123a087970837afdebed1.tar.gz
unit-78c133d0ca3c343135e123a087970837afdebed1.tar.bz2
Var: simplified length calculation for $status variable.
Diffstat (limited to 'src')
-rw-r--r--src/nxt_http_variables.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nxt_http_variables.c b/src/nxt_http_variables.c
index ec744317..a4205eec 100644
--- a/src/nxt_http_variables.c
+++ b/src/nxt_http_variables.c
@@ -455,7 +455,6 @@ nxt_http_var_body_bytes_sent(nxt_task_t *task, nxt_str_t *str, void *ctx,
static nxt_int_t
nxt_http_var_status(nxt_task_t *task, nxt_str_t *str, void *ctx, void *data)
{
- u_char *p;
nxt_http_request_t *r;
r = ctx;
@@ -465,9 +464,9 @@ nxt_http_var_status(nxt_task_t *task, nxt_str_t *str, void *ctx, void *data)
return NXT_ERROR;
}
- p = nxt_sprintf(str->start, str->start + 3, "%03d", r->status);
+ (void) nxt_sprintf(str->start, str->start + 3, "%03d", r->status);
- str->length = p - str->start;
+ str->length = 3;
return NXT_OK;
}