Fixed false memset warning on Linux with -O3 (ticket #275).

Prodded by John Leach.
This commit is contained in:
Maxim Dounin 2013-02-13 14:39:46 +00:00
parent 2761d480a2
commit d2c9f4554f

View File

@ -489,8 +489,11 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
}
b->last = ngx_cpymem(b->last, "</a>", sizeof("</a>") - 1);
ngx_memset(b->last, ' ', NGX_HTTP_AUTOINDEX_NAME_LEN - len);
b->last += NGX_HTTP_AUTOINDEX_NAME_LEN - len;
if (NGX_HTTP_AUTOINDEX_NAME_LEN - len > 0) {
ngx_memset(b->last, ' ', NGX_HTTP_AUTOINDEX_NAME_LEN - len);
b->last += NGX_HTTP_AUTOINDEX_NAME_LEN - len;
}
}
*b->last++ = ' ';