summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
Diffstat (limited to 'src/http')
-rw-r--r--src/http/modules/ngx_http_log_module.c2
-rw-r--r--src/http/ngx_http_upstream.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c
index 0752d0394..1796ee27f 100644
--- a/src/http/modules/ngx_http_log_module.c
+++ b/src/http/modules/ngx_http_log_module.c
@@ -533,7 +533,7 @@ ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf,
ms = (ngx_msec_int_t)
((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec));
- ms = (ms >= 0) ? ms : 0;
+ ms = ngx_max(ms, 0);
return ngx_sprintf(buf, "%T.%03M", ms / 1000, ms % 1000);
}
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 273d3575e..522a60536 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -3710,7 +3710,7 @@ ngx_http_upstream_response_time_variable(ngx_http_request_t *r,
if (state[i].status) {
ms = (ngx_msec_int_t)
(state[i].response_sec * 1000 + state[i].response_msec);
- ms = (ms >= 0) ? ms : 0;
+ ms = ngx_max(ms, 0);
p = ngx_sprintf(p, "%d.%03d", ms / 1000, ms % 1000);
} else {