diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-08-20 13:37:26 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-08-20 13:37:26 +0000 |
commit | 9db33c92341ea89b6c4922d63242db21313034f8 (patch) | |
tree | 7c26d9c30b11b3e1a09a77cf2967f2e09d17174a /src/core/ngx_file.c | |
parent | 0f00b0a801008c2d2185285049b79a0a2fc01b49 (diff) | |
download | nginx-9db33c92341ea89b6c4922d63242db21313034f8.tar.gz nginx-9db33c92341ea89b6c4922d63242db21313034f8.zip |
fix copy destination name length, introduced in r3025
Diffstat (limited to 'src/core/ngx_file.c')
-rw-r--r-- | src/core/ngx_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c index dff522674..eb340a22a 100644 --- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -605,12 +605,12 @@ ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to, ngx_ext_rename_file_t *ext) cf.time = ext->time; cf.log = ext->log; - name = ngx_alloc(to->len + 1 + 10, ext->log); + name = ngx_alloc(to->len + 1 + 10 + 1, ext->log); if (name == NULL) { return NGX_ERROR; } - (void) ngx_sprintf(name, "%*s.%010uD%Z", to->len - 1, to->data, + (void) ngx_sprintf(name, "%*s.%010uD%Z", to->len, to->data, (uint32_t) ngx_next_temp_number(0)); if (ngx_copy_file(src->data, name, &cf) == NGX_OK) { |