comparison src/http/modules/ngx_http_log_module.c @ 3515:76d252724db5

use ngx_min() and ngx_max()
author Igor Sysoev <igor@sysoev.ru>
date Fri, 14 May 2010 09:55:33 +0000
parents bfe37ab335b5
children dd1570b6f237
comparison
equal deleted inserted replaced
3514:58865853f29b 3515:76d252724db5
531 531
532 tp = ngx_timeofday(); 532 tp = ngx_timeofday();
533 533
534 ms = (ngx_msec_int_t) 534 ms = (ngx_msec_int_t)
535 ((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec)); 535 ((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec));
536 ms = (ms >= 0) ? ms : 0; 536 ms = ngx_max(ms, 0);
537 537
538 return ngx_sprintf(buf, "%T.%03M", ms / 1000, ms % 1000); 538 return ngx_sprintf(buf, "%T.%03M", ms / 1000, ms % 1000);
539 } 539 }
540 540
541 541