You should ensure that `remaining_chars > 0`