because b->lines and b->nlines would be 0 with no lines read.
reproduce: printf '' | sort or cols
bug was introduced by commit: 66a5ea722d18fc76ce7c5c4323e8cfebe58e7517
It's not useful when 0 is returned anyway, so be sure that we have a
string with length > 0, this also solves some indexing-gotchas like
"len - 1" and so on.
Also, add checked getline()'s whenever it has been forgotten and
clean up the error-messages.
This is a useful behavior if you want to reorder the lines,
because otherwise you might end up with originally two lines
on one, e.g.
$ echo -ne "foo\nbar" | sort
barfoo