0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-30 22:34:15 -05:00

logging: Fix off-by-one for roll size MB from Caddyfile

"10mb" now results in 10, rather than 9.
This commit is contained in:
Matthew Holt 2020-03-24 08:20:43 -06:00
parent d08cbefff8
commit 9af05719bc

View file

@ -168,7 +168,7 @@ func (fw *FileWriter) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if err != nil { if err != nil {
return d.Errf("parsing size: %v", err) return d.Errf("parsing size: %v", err)
} }
fw.RollSizeMB = int(size) / 1024 / 1024 fw.RollSizeMB = int(size)/1024/1024 + 1
case "roll_keep": case "roll_keep":
var keepStr string var keepStr string