9144d51594
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.