Mercurial > hg > nginx
diff src/mail/ngx_mail.c @ 2197:74477ea8074f
*) remove zero termination in ngx_inet_ntop() and ngx_sock_ntop()
*) use ngx_snprintf() in ngx_inet_ntop() and ngx_sock_ntop()
as they are called just once per connection
*) NGX_INET_ADDRSTRLEN
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 21 Aug 2008 18:47:23 +0000 |
parents | 2a92804f4109 |
children | 109849282793 |
line wrap: on
line diff
--- a/src/mail/ngx_mail.c +++ b/src/mail/ngx_mail.c @@ -358,13 +358,13 @@ ngx_mail_block(ngx_conf_t *cf, ngx_comma imip->addrs[i].ctx = in_addr[i].ctx; text = ngx_pnalloc(cf->pool, - INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1); + NGX_INET_ADDRSTRLEN + sizeof(":65535") - 1); if (text == NULL) { return NGX_CONF_ERROR; } len = ngx_inet_ntop(AF_INET, &in_addr[i].addr, text, - INET_ADDRSTRLEN); + NGX_INET_ADDRSTRLEN); len = ngx_sprintf(text + len, ":%d", in_port[p].port) - text;