Avoid extra allocations in ensureBuffer() caused by an off-by-one error.