Avoid interger overflow when calculating remaining line length
When the len and cidx were changed to size_t in a8a1b093, it was
possible to have an integer overflow when a line ended right at the
edge of the terminal width.
Signed-off-by: Allan McRae <allan@archlinux.org>
---
Replicate with linux-lts-3.0.39-1 in the Arch Linux [core] repo and a terminal
with 80 width.