Skip to content

Commit

Permalink
use ngx_copy instead of ngx_sprintf and indent.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroishi committed Aug 20, 2019
1 parent fef9a6e commit e0f5fa4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iijpta/ngx_http_secure_token_iijpta.c
Expand Up @@ -200,21 +200,21 @@ ngx_secure_token_iijpta_get_var(
size = sizeof("pta=") + (out_len * 2);
if (conf->avoid_cookies == 0)
{
size += COOKIE_ATTR_SIZE;
size += COOKIE_ATTR_SIZE;
}

p = ngx_pnalloc(r->pool, size);
if (p == NULL)
{
goto error;
goto error;
}
v->data = p;
p = ngx_copy(p, "pta=", sizeof("pta=") - 1);
p = ngx_hex_dump(p, out, out_len);

if (conf->avoid_cookies == 0)
{
p = ngx_sprintf(p, "; Expires=");
p = ngx_copy(p, "; Expires=", sizeof("; Expires=") - 1);
p = ngx_http_cookie_time(p, end);
p = ngx_sprintf(p, "; Max-Age=%T", end - ngx_time());
}
Expand Down

0 comments on commit e0f5fa4

Please sign in to comment.