fixed double free bug
don't try to take logarithm of 0 (fixes #1)

The (l)ist command tried to print the line number as log10(0) characters
wide if the last line to print was 0, which is obviously an error.