repaired infinite loop when maximum line length is reached. Now error code ia thrown correctly.