iolog: fix potential div-by-zero