Fix segfaults when opening directories with empty files

Apparently ngx_sprintf does not tolerate format specifiers
not matching their corresponding argument types.
pull/62/head
cat 2016-12-08 15:06:50 +05:00
parent ee17ca1a65
commit a551b5e3ea
1 changed files with 1 additions and 1 deletions

View File

@ -997,7 +997,7 @@ make_content_buf(
/* If we are showing the filesize in bytes, do not show a decimal */
if (j == DIM(sizes) - 1)
b->last = ngx_sprintf(b->last, "%d %s", length, sizes[j]);
b->last = ngx_sprintf(b->last, "%O %s", length, sizes[j]);
else
b->last = ngx_sprintf(b->last, "%.1f %s",
(float) length / multiplier, sizes[j]);