diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-08-21 18:47:23 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-08-21 18:47:23 +0000 |
commit | 6a75019ad6847a5bf8c0dcd1f0ad87ed715add7e (patch) | |
tree | f7feb9bb2be60866bf079e19c0736dc0d3f160f3 /src/mail/ngx_mail.c | |
parent | bbe42c41e8f883185745706f92426aa9e73b3eab (diff) | |
download | nginx-6a75019ad6847a5bf8c0dcd1f0ad87ed715add7e.tar.gz nginx-6a75019ad6847a5bf8c0dcd1f0ad87ed715add7e.zip |
*) 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
Diffstat (limited to 'src/mail/ngx_mail.c')
-rw-r--r-- | src/mail/ngx_mail.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c index edfa245ee..73668a538 100644 --- a/src/mail/ngx_mail.c +++ b/src/mail/ngx_mail.c @@ -358,13 +358,13 @@ ngx_mail_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 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; |